Пример #1
0
        public static Task Nav_Resolution_Scaling_Main(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = SM_Settings_Menu.SM_Settings_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "P1")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_VC_Menu.Resolution_Scaling_VC_P1_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "P2IS")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_VC_Menu.Resolution_Scaling_VC_P2IS_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "P2EP")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_VC_Menu.Resolution_Scaling_VC_P2EP_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "P3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_VC_Menu.Resolution_Scaling_VC_P3_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "P4")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_P4_PS2_Menu.Resolution_Scaling_P4_PS2_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "P4AU")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_P4AU_Menu.Resolution_Scaling_P4AU_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "P4D")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_P4D_Menu.Resolution_Scaling_P4D_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_SM_Tutorial_Anime_Frames_Page_1(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = SM_Tutorial_Select_Menu.SM_Tutorial_Select_Advanced(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "▶️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = SM_Tutorial_Anime_Frames_Menu.SM_Tutorial_Anime_Frames_Page_2(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_Resolution_Scaling_P4D_Scaling_Method_Confirm(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "💠")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_P4D_Menu.Resolution_Scaling_P4D_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "❌")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Attempt to delete the menu message from the channel if it hasn't been deleted by the user yet. If this fails, catch the exception.
                try
                {
                    _ = menuSession.MenuMessage.DeleteAsync();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }

                // If the menu session is not null, remove it from the global list.
                if (menuSession != null)
                {
                    Global.MenuIdList.Remove(menuSession);
                }
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        // Methods that suppliment the functionality of the menus.
        public static Task VersionControlMenuDirectory(SocketReaction reaction, MenuIdStructure menuSession)
        {
            // Search for a content filter list that corresponds to the user's ID.
            var filterSession = Global.ContentFilterList.SingleOrDefault(x => x.User.Id == reaction.UserId);

            // Get the account information of the command's user.
            var account = UserInfoClasses.GetAccount(menuSession.User);

            //Check each field of titles with alternate versions to see if they have been chosen.
            // Persona
            if (filterSession.P1_Select == true && (filterSession.P1_VC_PSX_Select == false && filterSession.P1_VC_PSP_Select == false))
            {
                // Go to a new menu.
                _ = Content_Filter_Menu.Content_Filter_VC_P1_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            // Persona 2: Innocent Sin
            else if (filterSession.P2IS_Select == true && (filterSession.P2IS_VC_PSX_Select == false && filterSession.P2IS_VC_PSP_Select == false))
            {
                // Go to a new menu.
                _ = Content_Filter_Menu.Content_Filter_VC_P2IS_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            // Persona 2: Eternal Punishment
            else if (filterSession.P2EP_Select == true && (filterSession.P2EP_VC_PSX_Select == false && filterSession.P2EP_VC_PSP_Select == false))
            {
                // Go to a new menu.
                _ = Content_Filter_Menu.Content_Filter_VC_P2EP_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            // Persona 3
            else if (filterSession.P3_Select == true && (filterSession.P3_VC_P3F_Select == false && filterSession.P3_VC_P3P_Select == false))
            {
                // Go to a new menu.
                _ = Content_Filter_Menu.Content_Filter_VC_P3_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            // Persona 4
            else if (filterSession.P4_Select == true && (filterSession.P4_VC_PS2_Select == false && filterSession.P4_VC_P4G_Select == false))
            {
                // Go to a new menu.
                _ = Content_Filter_Menu.Content_Filter_VC_P4_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            // Persona 5
            else if (filterSession.P5_Select == true && (filterSession.P5_VC_PS4_Select == false && filterSession.P5_VC_P5R_Select == false))
            {
                // Go to a new menu.
                _ = Content_Filter_Menu.Content_Filter_VC_P5_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Now, assemble the user's content filter string.
            // Create an empty string variable that will represent the user's content filter string.
            string user_filter = "";

            // Based on the titles the user selected, construct a content filter string for them.
            // Revelations: Persona
            if (filterSession.P1_VC_PSX_Select == true)
            {
                user_filter += "P1-PS1;";
            }

            // Persona (Remake)
            if (filterSession.P1_VC_PSP_Select == true)
            {
                user_filter += "P1-PSP;";
            }

            // Persona 2: Innocent Sin (PlayStation)
            if (filterSession.P2IS_VC_PSX_Select == true)
            {
                user_filter += "P2IS-PS1;";
            }

            // Persona 2: Innocent Sin (Remake)
            if (filterSession.P2IS_VC_PSP_Select == true)
            {
                user_filter += "P2IS-PSP;";
            }

            // Persona 2: Eternal Punishment (PlayStation)
            if (filterSession.P2EP_VC_PSX_Select == true)
            {
                user_filter += "P2EP-PS1;";
            }

            // Persona 2: Eternal Punishment (Remake)
            if (filterSession.P2EP_VC_PSP_Select == true)
            {
                user_filter += "P2EP-PSP;";
            }

            // Persona 3 FES
            if (filterSession.P3_VC_P3F_Select == true)
            {
                user_filter += "P3F;";
            }

            // Persona 3 Portable
            if (filterSession.P3_VC_P3P_Select == true)
            {
                user_filter += "P3P;";
            }

            // Persona 4 (PlayStation 2)
            if (filterSession.P4_VC_PS2_Select == true)
            {
                user_filter += "P4-PS2;";
            }

            // Persona 4 Golden
            if (filterSession.P4_VC_P4G_Select == true)
            {
                user_filter += "P4G;";
            }

            // Persona 4 Arena Ultimax
            if (filterSession.P4AU_Select == true)
            {
                user_filter += "P4AU;";
            }

            // Persona 4: Dancing All Night
            if (filterSession.P4D_Select == true)
            {
                user_filter += "P4D;";
            }

            // Persona 5 (PlayStation 4)
            if (filterSession.P5_VC_PS4_Select == true)
            {
                user_filter += "P5-PS4;";
            }

            // Persona 5 Royal
            if (filterSession.P5_VC_P5R_Select == true)
            {
                user_filter += "P5R;";
            }

            // BlazBlue: Cross Tag Battle
            if (filterSession.BBTAG_Select == true)
            {
                user_filter += "BBTAG;";
            }

            // Assign the created content filter list to the user's account.
            account.Content_Filter = user_filter;

            // Next, check if the user completely filtered out any titles that match with their currently set profile theme. If so, set their profile theme to none.
            if ((account.Profile_Theme == "P3" && filterSession.P3_VC_P3F_Select == true && filterSession.P3_VC_P3P_Select == true) ||
                (account.Profile_Theme == "P4" && filterSession.P4_VC_PS2_Select == true && filterSession.P4_VC_P4G_Select == true) ||
                (account.Profile_Theme == "P5" && filterSession.P5_VC_PS4_Select == true && filterSession.P5_VC_P5R_Select == true))
            {
                account.Profile_Theme = "";
            }

            // Update the user's account with new data.
            UserInfoClasses.UpdateAccount(account);

            // Go to the confirmation menu.
            _ = Content_Filter_Menu.Content_Filter_Confirm(menuSession.User, menuSession.MenuMessage);

            return(Task.CompletedTask);
        }
        public static Task Nav_Template_Layout_P4_PS2_Date_Weather(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P4_PS2_Menu.Template_Layout_P4_PS2_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.P4_PS2_TS_HUD = "Normal";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P4_PS2_Menu.Template_Layout_P4_PS2_Date_Weather_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.P4_PS2_TS_HUD = "TV World";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P4_PS2_Menu.Template_Layout_P4_PS2_Date_Weather_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Three
            else if (reaction.Emote.Name == "\u0033\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.P4_PS2_TS_HUD = "None";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P4_PS2_Menu.Template_Layout_P4_PS2_Date_Weather_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
Пример #6
0
        public static Task Nav_Template_Layout_P1_PS1_Wallpaper(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P1_PSX_TS_Wallpaper = "Type 1";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P1_PSX_TS_Wallpaper = "Type 2";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Three
            else if (reaction.Emote.Name == "\u0033\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P1_PSX_TS_Wallpaper = "Type 3";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Four
            else if (reaction.Emote.Name == "\u0034\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P1_PSX_TS_Wallpaper = "Type 4";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Five
            else if (reaction.Emote.Name == "\u0035\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P1_PSX_TS_Wallpaper = "Type 5";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Six
            else if (reaction.Emote.Name == "\u0036\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P1_PSX_TS_Wallpaper = "Type 6";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Seven
            else if (reaction.Emote.Name == "\u0037\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P1_PSX_TS_Wallpaper = "Type 7";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Eight
            else if (reaction.Emote.Name == "\u0038\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P1_PSX_TS_Wallpaper = "Type 8";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        // Methods that activate on the ReactionRemoved event.
        public static Task Nav_Content_Filter_Main_Removed(SocketReaction reaction, MenuIdStructure menuSession)
        {
            // Search for a content filter list that corresponds to the user's ID.
            var filterSession = Global.ContentFilterList.SingleOrDefault(x => x.User.Id == reaction.UserId);

            if (reaction.Emote.Name == "P1")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.P1_Select = false;

                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P2IS")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.P2IS_Select = false;

                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P2EP")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.P2EP_Select = false;

                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P3")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.P3_Select = false;

                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P4")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.P4_Select = false;

                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P4AU")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.P4AU_Select = false;

                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P4D")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.P4D_Select = false;

                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P5")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.P5_Select = false;

                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "BBTAG")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.BBTAG_Select = false;

                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_Resolution_Scaling_P2EP_PSP_Main(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_VC_Menu.Resolution_Scaling_VC_P2EP_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_P2EP_PSP_Menu.Resolution_Scaling_P2EP_PSP_Output_Resolution(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_P2EP_PSP_Menu.Resolution_Scaling_P2EP_PSP_Scaling_Method(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static async Task SetFirstThemeMain(SocketTextChannel channel, SocketGuildUser user)
        {
            // Get the account information of the command's user.
            var account = UserInfoClasses.GetAccount(user);

            // Create a list variable containing the content filter of the command user.
            List <string> user_filter = ContentFilterMethods.ParseContentFilter(account);

            // Create bool values for each of the profile themes.
            // These are meant to check whether or not all versions of a title are completely blocked in the user's content filter.
            // False indicates at least one version is allowed, True indicates no versions are allowed. The condition is False by default.
            bool p3_filter_check = false;
            bool p4_filter_check = false;
            bool p5_filter_check = false;

            // If both versions of P3 are blocked in the user's content filter, set p3_filter_check to true.
            if (user_filter.Contains("P3F") == true && user_filter.Contains("P3P") == true)
            {
                p3_filter_check = true;
            }

            // If both versions of P4 are blocked in the user's content filter, set p4_filter_check to true.
            if (user_filter.Contains("P4-PS2") == true && user_filter.Contains("P4G") == true)
            {
                p4_filter_check = true;
            }

            // If both versions of P5 are blocked in the user's content filter, set p5_filter_check to true.
            if (user_filter.Contains("P5-PS4") == true && user_filter.Contains("P5R") == true)
            {
                p5_filter_check = true;
            }

            // Start building the embeded message.
            var embed  = new EmbedBuilder();
            var author = new EmbedAuthorBuilder
            {
                Name    = "Setting a Theme",
                IconUrl = user.GetAvatarUrl()
            };

            embed.WithAuthor(author);

            embed.WithThumbnailUrl("https://i.imgur.com/DJyqN5w.png");

            // Create a default string to be used as the description's text. This can change depending on the circumstances.
            string description_text = "" +
                                      "Set your profile theme by reacting to one of the icons below.\n" +
                                      "\n" +
                                      "The appearance of your commands will change based on each one, and you can switch to a different profile theme at any time.\n\n";

            // If all versions for all profile themes are filtered out, replace the default description text and add a footer.
            if (p3_filter_check == true && p4_filter_check == true && p5_filter_check == true)
            {
                description_text = "" +
                                   "Profile themes based on certain Persona titles can be chosen to customize your experience.\n" +
                                   "\n" +
                                   "The appearance of your commands will change based on each one, and you can switch to a different profile theme at any time.\n" +
                                   "\n" +
                                   ":warning: No profile themes can be chosen due to your content filter. " +
                                   $"You can edit your content filter at any time from the **`{BotConfig.bot.cmdPrefix}settings`** menu by choosing [General Settings] > [Content Filter].";

                var footer = new EmbedFooterBuilder
                {
                    Text = $"❌ Close Menu"
                };
                embed.WithFooter(footer);
            }
            // Else, if at least one title is completely filtered out but some are still remaining, add on to the end of the default description text.
            else if (p3_filter_check == true || p4_filter_check == true || p5_filter_check == true)
            {
                description_text += ":warning: Some options are unavailable due to your content filter.";
            }

            // Add the description text to the embeded message.
            embed.WithDescription(description_text);

            // Create a null variable for the message.
            RestUserMessage message = null;

            // Try to send a message to the channel. If the bot lacks permissions, catch the exception and return.
            try
            {
                message = await channel.SendMessageAsync("", false, embed.Build());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return;
            }

            // Create a new menu identifier entry for this current message and user to keep track of the overall menu status.
            var menuSession = new MenuIdStructure()
            {
                User        = user,
                MenuMessage = message,
                CurrentMenu = "Set_First_Theme_Main",
                MenuTimer   = new Timer()
                {
                    // Create a timer that expires as a "time out" duration for the user.
                    Interval  = MenuConfig.menu.timerDuration,
                    AutoReset = false,
                    Enabled   = true
                }
            };

            // Add the menu entry to the global list.
            Global.MenuIdList.Add(menuSession);

            // If the menu timer runs out, activate a function.
            menuSession.MenuTimer.Elapsed += (sender, e) => MenuTimer_Elapsed(sender, e, menuSession);

            // Create an empty list for reactions.
            List <IEmote> reaction_list = new List <IEmote> {
            };

            // Depending on the user's content filter settings, add needed emote reactions to the menu.
            if (p3_filter_check == false)
            {
                reaction_list.Add(Emote.Parse("<:P3:751133114918633483>"));
            }

            if (p4_filter_check == false)
            {
                reaction_list.Add(Emote.Parse("<:P4:751133120530612274>"));
            }

            if (p5_filter_check == false)
            {
                reaction_list.Add(Emote.Parse("<:P5:751133123861020742>"));
            }

            if (p3_filter_check == true && p4_filter_check == true && p5_filter_check == true)
            {
                reaction_list.Add(new Emoji("❌"));
            }

            // Add the reactions to the message.
            _ = ReactionHandling.AddReactionsToMenu(message, reaction_list);
        }
        public static Task Nav_Template_Layout_BBTAG_Background_Blur(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_BBTAG_Menu.Template_Layout_BBTAG_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.BBTAG_TS_BG_Blur = "On";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_BBTAG_Menu.Template_Layout_BBTAG_Background_Blur_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.BBTAG_TS_BG_Blur = "Off";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_BBTAG_Menu.Template_Layout_BBTAG_Background_Blur_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_Template_Layout_BBTAG_Header(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_BBTAG_Menu.Template_Layout_BBTAG_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.BBTAG_TS_Header = "Prologue";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_BBTAG_Menu.Template_Layout_BBTAG_Header_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.BBTAG_TS_Header = "Episode BlazBlue";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_BBTAG_Menu.Template_Layout_BBTAG_Header_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Three
            else if (reaction.Emote.Name == "\u0033\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.BBTAG_TS_Header = "Episode P4A";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_BBTAG_Menu.Template_Layout_BBTAG_Header_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Four
            else if (reaction.Emote.Name == "\u0034\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.BBTAG_TS_Header = "Episode Under Night In-Birth";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_BBTAG_Menu.Template_Layout_BBTAG_Header_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Five
            else if (reaction.Emote.Name == "\u0035\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.BBTAG_TS_Header = "Episode RWBY";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_BBTAG_Menu.Template_Layout_BBTAG_Header_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Six
            else if (reaction.Emote.Name == "\u0036\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.BBTAG_TS_Header = "Episode Extra";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_BBTAG_Menu.Template_Layout_BBTAG_Header_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_Version_Control_Main(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = SM_Settings_Menu.SM_Settings_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P1")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Version_Control_Menu.Version_Control_P1(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P2IS")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Version_Control_Menu.Version_Control_P2IS(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P2EP")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Version_Control_Menu.Version_Control_P2EP(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Version_Control_Menu.Version_Control_P3(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P4")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Version_Control_Menu.Version_Control_P4(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P5")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Version_Control_Menu.Version_Control_P5(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
Пример #13
0
        public static Task Nav_Template_Layout_P2IS_PS1_Wallpaper(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P2IS_PSX_TS_Wallpaper = "Blue Tone";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P2IS_PSX_TS_Wallpaper = "Sepia Tone";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Three
            else if (reaction.Emote.Name == "\u0033\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P2IS_PSX_TS_Wallpaper = "Purple Tone";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Four
            else if (reaction.Emote.Name == "\u0034\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P2IS_PSX_TS_Wallpaper = "Seventh";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Five
            else if (reaction.Emote.Name == "\u0035\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P2IS_PSX_TS_Wallpaper = "Baofu";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Six
            else if (reaction.Emote.Name == "\u0036\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P2IS_PSX_TS_Wallpaper = "NWO";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Seven
            else if (reaction.Emote.Name == "\u0037\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P2IS_PSX_TS_Wallpaper = "Dragon";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Eight
            else if (reaction.Emote.Name == "\u0038\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P2IS_PSX_TS_Wallpaper = "Jack Frost";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Nine
            else if (reaction.Emote.Name == "\u0039\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P2IS_PSX_TS_Wallpaper = "Grid";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Ten
            else if (reaction.Emote.Name == "🔟")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen wallpaper to the user's account settings.
                account.P2IS_PSX_TS_Wallpaper = "Star";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PS1_Menu.Template_Layout_P2IS_PS1_Wallpaper_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
Пример #14
0
        public static Task Nav_Help_Main_Menu(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "🔷")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Status_Tutorial_Menu.Status_Tutorial_Page_1(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "🟠")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = SM_Tutorial_Select_Menu.SM_Tutorial_Select_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "⚖️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Legal_Notices_Menu.Legal_Notices_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "📄")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Credits_Menu.Credits_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "❌")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Attempt to delete the menu message from the channel if it hasn't been deleted by the user yet. If this fails, catch the exception.
                try
                {
                    _ = menuSession.MenuMessage.DeleteAsync();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }

                // If the menu session is not null, remove it from the global list.
                if (menuSession != null)
                {
                    Global.MenuIdList.Remove(menuSession);
                }
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        // Methods that activate on the MessageReceived event.
        public static Task Nav_Backgrounds_Default_Color_Message_Received(SocketMessage message, MenuIdStructure menuSession)
        {
            // Store the text of the message in a string and convert all letters to uppercase.
            string input_string = message.Content.ToUpper();

            // Take a substring consisting of the first character of the input string.
            string first_char = input_string.Substring(0, 1);

            // If the first character is not the pound symbol, add it to the beginning of the input string.
            if (first_char != "#")
            {
                input_string = "#" + input_string;
            }

            // Check if the input string is a valid HTML color.
            if (CheckValidFormatHtmlColor(input_string) == true)
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.Setting_BG_Color = input_string;

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Backgrounds_Menu.Backgrounds_Default_Color_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            // If the input string is not a valid HTML color, go to an error menu.
            else if (CheckValidFormatHtmlColor(input_string) == false)
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Backgrounds_Menu.Backgrounds_Default_Color_Error(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_First_Use_Content_Filter_Confirm(SocketReaction reaction, MenuIdStructure menuSession)
        {
            // This reaction handler is inactive as the menu message is meant to stay permanently. Keeping in case of regression.

            // Search for a content filter list that corresponds to the user's ID.
            var filterSession = Global.ContentFilterList.SingleOrDefault(x => x.User.Id == reaction.UserId);

            if (reaction.Emote.Name == "❌")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Attempt to delete the menu message from the channel if it hasn't been deleted by the user yet. If this fails, catch the exception.
                try
                {
                    _ = menuSession.MenuMessage.DeleteAsync();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }

                // If the menu session is not null, remove it and the filter session from the global list.
                if (menuSession != null)
                {
                    Global.MenuIdList.Remove(menuSession);
                    Global.ContentFilterList.Remove(filterSession);
                }
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
Пример #17
0
        public static Task Nav_Template_Layout_P1_PS1_Placement(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.P1_PSX_TS_Position = "Left";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Placement_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.P1_PSX_TS_Position = "Center";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Placement_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Three
            else if (reaction.Emote.Name == "\u0033\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.P1_PSX_TS_Position = "Right";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Placement_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Four
            else if (reaction.Emote.Name == "\u0034\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.P1_PSX_TS_Position = "Switch";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P1_PS1_Menu.Template_Layout_P1_PS1_Placement_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
Пример #18
0
        public static Task Nav_Status_Decor_Main(SocketReaction reaction, MenuIdStructure menuSession)
        {
            // Search for an item list that corresponds to the user's ID. If a menu entry was found, this should also exist alongside it.
            var itemSession = Global.ItemIdList.SingleOrDefault(x => x.User.Id == reaction.UserId);

            // Perform various actions based on what type of reaction was given to the message.
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = Status_Decor_Menu.Status_Decor_Exit(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Previous Page
            else if (reaction.Emote.Name == "◀️")
            {
                try
                {
                    // Decrease the item index by the maximum number of items that should be displayed to the user at once.
                    itemSession.ItemIndexBase -= itemSession.MaxItemsDisplayed;

                    // Decrease the page counter by one.
                    itemSession.CurrentPage--;

                    // Stop the timeout timer associated with the menu.
                    menuSession.MenuTimer.Stop();

                    // Go to a new menu.
                    _ = Status_Decor_Menu.Status_Decor_Main(menuSession.User, menuSession.MenuMessage);
                    return(Task.CompletedTask);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }

            // Next Page
            else if (reaction.Emote.Name == "▶️")
            {
                try
                {
                    // Increase the item index by the maximum number of items that should be displayed to the user at once.
                    itemSession.ItemIndexBase += itemSession.MaxItemsDisplayed;

                    // Increase the page counter by one.
                    itemSession.CurrentPage++;

                    // Stop the timeout timer associated with the menu.
                    menuSession.MenuTimer.Stop();

                    // Go to a new menu.
                    _ = Status_Decor_Menu.Status_Decor_Main(menuSession.User, menuSession.MenuMessage);
                    return(Task.CompletedTask);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Status_Decor_Menu.Set_Decor_Preview(menuSession.User, menuSession.MenuMessage, itemSession.ItemIndexBase);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Status_Decor_Menu.Set_Decor_Preview(menuSession.User, menuSession.MenuMessage, itemSession.ItemIndexBase + 1);
                return(Task.CompletedTask);
            }

            // Keycap Three
            else if (reaction.Emote.Name == "\u0033\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Status_Decor_Menu.Set_Decor_Preview(menuSession.User, menuSession.MenuMessage, itemSession.ItemIndexBase + 2);
                return(Task.CompletedTask);
            }

            // Keycap Four
            else if (reaction.Emote.Name == "\u0034\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Status_Decor_Menu.Set_Decor_Preview(menuSession.User, menuSession.MenuMessage, itemSession.ItemIndexBase + 3);
                return(Task.CompletedTask);
            }

            // Keycap Five
            else if (reaction.Emote.Name == "\u0035\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Status_Decor_Menu.Set_Decor_Preview(menuSession.User, menuSession.MenuMessage, itemSession.ItemIndexBase + 4);
                return(Task.CompletedTask);
            }

            // Keycap Six
            else if (reaction.Emote.Name == "\u0036\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Status_Decor_Menu.Set_Decor_Preview(menuSession.User, menuSession.MenuMessage, itemSession.ItemIndexBase + 5);
                return(Task.CompletedTask);
            }

            // Sort Shop
            else if (reaction.Emote.Name == "⚙️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Status_Decor_Menu.Decor_Sort(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // If the user reacts with the box emote, we want to remove the current décor.
            else if (reaction.Emote.Name == "🔳")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Decor_Setting setting to an empty string.
                account.Decor_Setting = "";

                // Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = Status_Decor_Menu.Set_Decor_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        // Methods that activate on the ReactionAdded event.
        public static Task Nav_Content_Filter_Main_Added(SocketReaction reaction, MenuIdStructure menuSession)
        {
            // Search for a content filter list that corresponds to the user's ID.
            var filterSession = Global.ContentFilterList.SingleOrDefault(x => x.User.Id == reaction.UserId);

            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = General_Settings_Menu.General_Settings_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P1")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.P1_Select = true;
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P2IS")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.P2IS_Select = true;
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P2EP")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.P2EP_Select = true;
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P3")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.P3_Select = true;
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P4")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.P4_Select = true;
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P4AU")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.P4AU_Select = true;
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P4D")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.P4D_Select = true;
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "P5")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.P5_Select = true;
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "BBTAG")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.BBTAG_Select = true;
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "✅")
            {
                filterSession.Menu_List = CreateMenuList(reaction);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Decide what menu to go to next.
                _ = VersionControlMenuDirectory(reaction, menuSession);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
Пример #20
0
        public static Task Nav_Decor_Sort(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = Status_Decor_Menu.Status_Decor_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap one
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "title_a_z";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = Status_Decor_Menu.Decor_Sort_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "title_z_a";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = Status_Decor_Menu.Decor_Sort_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap three
            else if (reaction.Emote.Name == "\u0033\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "cost_low_high";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = Status_Decor_Menu.Decor_Sort_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap four
            else if (reaction.Emote.Name == "\u0034\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "cost_high_low";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = Status_Decor_Menu.Decor_Sort_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap five
            else if (reaction.Emote.Name == "\u0035\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "release_old_new";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = Status_Decor_Menu.Decor_Sort_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap six
            else if (reaction.Emote.Name == "\u0036\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "release_new_old";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = Status_Decor_Menu.Decor_Sort_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_Content_Filter_VC_P5_Main_Removed(SocketReaction reaction, MenuIdStructure menuSession)
        {
            // Search for a content filter list that corresponds to the user's ID.
            var filterSession = Global.ContentFilterList.SingleOrDefault(x => x.User.Id == reaction.UserId);

            // Keycap One
            if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.P5_VC_PS4_Select = false;
                return(Task.CompletedTask);
            }
            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // If this option is selected, change the value to false in the filter list.
                filterSession.P5_VC_P5R_Select = false;
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_Template_Layout_P2IS_PSP_Main(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_VC_Menu.Template_Layout_VC_P2IS_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PSP_Menu.Template_Layout_P2IS_PSP_Inverted_Filter(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P2IS_PSP_Menu.Template_Layout_P2IS_PSP_Placement(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_Content_Filter_VC_P1_Main_Added(SocketReaction reaction, MenuIdStructure menuSession)
        {
            // Search for a content filter list that corresponds to the user's ID.
            var filterSession = Global.ContentFilterList.SingleOrDefault(x => x.User.Id == reaction.UserId);

            if (reaction.Emote.Name == "↩️")
            {
                // Change the options on this menu to false.
                filterSession.P1_VC_PSX_Select = false;
                filterSession.P1_VC_PSP_Select = false;

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Create a new instance of this class in order to call the non-static ReturnToPreviousMenu method.
                Content_Filter_Reactions content_nav = new Content_Filter_Reactions();

                // Call the ReturnToPreviousMenu method to return to the previous menu.
                content_nav.ReturnToPreviousMenu(reaction, menuSession);

                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.P1_VC_PSX_Select = true;
                return(Task.CompletedTask);
            }
            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // If this option is selected, change the value to true in the filter list.
                filterSession.P1_VC_PSP_Select = true;
                return(Task.CompletedTask);
            }
            else if (reaction.Emote.Name == "✅")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Decide which menu to go to next.
                _ = VersionControlMenuDirectory(reaction, menuSession);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
Пример #24
0
        public static async Task ShopStart(SocketTextChannel channel, SocketGuildUser user)
        {
            //Get the account information of the command's target
            var account = UserInfoClasses.GetAccount(user);

            var embed  = new EmbedBuilder();
            var author = new EmbedAuthorBuilder
            {
                Name    = "Now Loading...",
                IconUrl = user.GetAvatarUrl()
            };

            embed.WithAuthor(author);

            //Determine color for embeded message
            if (account.Profile_Theme == "P3")
            {
                embed.WithColor(37, 149, 255);
            }
            else if (account.Profile_Theme == "P4")
            {
                embed.WithColor(255, 229, 49);
            }
            else if (account.Profile_Theme == "P5")
            {
                embed.WithColor(213, 27, 4);
            }

            // Create a null variable for the message.
            RestUserMessage message = null;

            // Try to send a message to the channel. If the bot lacks permissions, catch the exception and return.
            try
            {
                message = await channel.SendMessageAsync("", false, embed.Build());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return;
            }

            // Create a string list variable.
            List <string> original_decor_list;

            // Depending on the user's settings, fill the string list with an assortment of décor according to how the user wishes for it to be organized.
            original_decor_list = DecorInfoMethods.CreateSortSettingList(account.Shop_Sort);

            // Create an empty string list.
            List <string> owned_decor = new List <string> {
            };

            // Check if the user owns any décor.
            if (account.Decor_Owned != "")
            {
                // If so, convert their Decor_Owned value into a string list and assign it to the owned_decor string list.
                owned_decor = DecorInfoMethods.StringToStringArray(account.Decor_Owned);
            }

            // Start comparing the user's owned_decor list to the created decor_list for the shop.
            // If the user owns any décor from the decor_list or has content blocked, remove the matching entry from the list
            var new_decor_list = original_decor_list.Except(owned_decor).ToList();

            // Create another empty string list.
            List <string> user_content_filter = new List <string> {
            };

            // Check if the user has any titles listed in their content filter.
            if (account.Content_Filter != "")
            {
                // If so, convert their Content_Filter value into a string list and assign it to the user_content_filter string list.
                user_content_filter = DecorInfoMethods.StringToStringArray(account.Content_Filter);
            }

            // Create a new list by removing any décor that contains content specified in the user's content filter and assign it to the new_decor_list variable.
            new_decor_list = DecorInfoMethods.RemoveBlockedContentFromList(new_decor_list, user_content_filter);

            // Search for an item list that corresponds to the user's ID.
            var itemSession = Global.ItemIdList.SingleOrDefault(x => x.User.Id == user.Id);

            // If an item session already exists, remove it from the global list.
            if (itemSession != null)
            {
                Global.ItemIdList.Remove(itemSession);
            }

            // Create a new item identifier entry for this current user to keep track of the position of décor on the menu.
            itemSession = new ItemListIterator()
            {
                User              = user,
                ItemList          = new_decor_list,
                ItemIndexBase     = 0,
                MaxItemsDisplayed = 6,
                CurrentPage       = 1
            };

            // Add the item entry to the global list.
            Global.ItemIdList.Add(itemSession);

            // Create a new menu identifier entry for this current message and user to keep track of the overall menu status.
            var idTracker = new MenuIdStructure()
            {
                User        = user,
                MenuMessage = message,
                CurrentMenu = "Shop_Start",
                MenuTimer   = new Timer()
                {
                    // Create a timer that expires as a "time out" duration for the user.
                    Interval  = MenuConfig.menu.timerDuration,
                    AutoReset = false,
                    Enabled   = true
                }
            };

            // Add the menu entry to the global list.
            Global.MenuIdList.Add(idTracker);

            // Create a new menu in the current channel.
            await ShopMainMenu(idTracker.User, idTracker.MenuMessage);
        }
        public static Task Nav_Profile_Theme_Main(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Profile_Settings_Menu.Profile_Settings_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "P3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen profile theme to the user's account.
                account.Profile_Theme = "P3";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Profile_Theme_Menu.Profile_Theme_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "P4")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen profile theme to the user's account.
                account.Profile_Theme = "P4";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Profile_Theme_Menu.Profile_Theme_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "P5")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen profile theme to the user's account.
                account.Profile_Theme = "P5";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Profile_Theme_Menu.Profile_Theme_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
Пример #26
0
        private static async void MenuTimer_Elapsed(object sender, ElapsedEventArgs e, MenuIdStructure idTracker, ItemListIterator itemSession)
        {
            // Attempt deleting the message if it hasn't been deleted by the user yet.
            // If it has, catch the exception, remove the menu and item entries from the global list, and return.
            try
            {
                // Delete the current message from the channel.
                await idTracker.MenuMessage.DeleteAsync();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);

                // Remove the menu and item entries from the global list.
                Global.MenuIdList.Remove(idTracker);
                Global.ItemIdList.Remove(itemSession);

                return;
            }

            // Reassign the menu session's message to a new message generated from the created embed.
            idTracker.MenuMessage = (RestUserMessage)await idTracker.MenuMessage.Channel.SendMessageAsync("", false, MenuTimedOut(idTracker.User).Build());

            // Remove the menu and item entries from the global list
            Global.MenuIdList.Remove(idTracker);
            Global.ItemIdList.Remove(itemSession);
        }
        private static async void MenuTimer_Elapsed(object sender, ElapsedEventArgs e, MenuIdStructure menuSession)
        {
            // Assign the menu session's message to another variable.
            var message = menuSession.MenuMessage;

            // Attempt editing the message if it hasn't been deleted by the user yet.
            // If it has, catch the exception, remove the menu entry from the global list, and return.
            try
            {
                // Remove all reactions from the current message.
                await message.RemoveAllReactionsAsync();

                // Edit the current active message by replacing it with the recently created embed.
                await message.ModifyAsync(x => {
                    x.Embed = MenuTimedOut(menuSession.User).Build();
                });
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);

                // Remove the menu entry from the global list.
                Global.MenuIdList.Remove(menuSession);

                return;
            }

            // Remove the menu entry from the global list.
            Global.MenuIdList.Remove(menuSession);
        }
        public static Task Nav_Backgrounds_Default_Color_Error(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Backgrounds_Menu.Backgrounds_Default_Color(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_Resolution_Scaling_P4D_Output_Resolution(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_P4D_Menu.Resolution_Scaling_P4D_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.P4D_Resolution = "960 × 544";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_P4D_Menu.Resolution_Scaling_P4D_Output_Resolution_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Assign the chosen setting to the user's account.
                account.P4D_Resolution = "1920 × 1088";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Resolution_Scaling_P4D_Menu.Resolution_Scaling_P4D_Output_Resolution_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_Template_Layout_P5R_Phone_Calls_Main(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P5R_Menu.Template_Layout_P5R_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap One
            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P5R_Menu.Template_Layout_P5R_Phone_Calls_Toggle(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            // Keycap Two
            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Template_Layout_P5R_Menu.Template_Layout_P5R_Phone_Calls_Location(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }