public static Task Nav_Settings_Main_Menu(SocketReaction reaction, MenuIdStructure menuSession)
        {
            // Keycap One
            if (reaction.Emote.Name == "\u0031\ufe0f\u20e3")
            {
                // 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);
            }

            // 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.
                _ = Profile_Settings_Menu.Profile_Settings_Main(menuSession.User, menuSession.MenuMessage);
                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.
                _ = SM_Settings_Menu.SM_Settings_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);
        }
        public static Task Nav_Rank_Up_Notifications_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.
                _ = General_Settings_Menu.General_Settings_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 rank up notification setting to "On".
                account.Rank_Up_Notifications = "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
                _ = Rank_Up_Notifications_Menu.Rank_Up_Notifications_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 rank up notification setting to "Off".
                account.Rank_Up_Notifications = "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
                _ = Rank_Up_Notifications_Menu.Rank_Up_Notifications_Confirm(menuSession.User, menuSession.MenuMessage);

                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
Example #3
0
        public static Task Nav_Time_Weather_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.
                _ = General_Settings_Menu.General_Settings_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
        public static Task Nav_Content_Filter_Confirm(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 == "💠")
            {
                // Remove the content filter entry from the global list.
                Global.ContentFilterList.Remove(filterSession);

                // 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 == "❌")
            {
                // 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);
        }
        // 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);
        }