コード例 #1
0
        public static Task Nav_Backgrounds_Default_Color(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_Main(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "🔳")
            {
                // 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 = "Transparent";

                //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);
            }

            return(Task.CompletedTask);
        }
コード例 #2
0
ファイル: TimeOut.cs プロジェクト: Microjack5/social-linker
        internal static string TimeOutStatus(SocketMessage message)
        {
            var      account      = UserInfoClasses.GetAccount(message.Author);
            DateTime current_time = DateTime.UtcNow;

            //If the user does not have a time out duration set, return
            if (account.Time_Out_Duration == 0)
            {
                return("No");
            }

            //Create a timespan for how much time has passed since the user was put in time out
            TimeSpan time_out_end = (TimeSpan)(current_time - account.Time_Out_Start);

            //If the number of minutes since the user was put in time out is less than their time out duration, they are still timed out
            if (time_out_end.TotalMinutes < account.Time_Out_Duration)
            {
                return("Yes");
            }

            //If not, reset their time out duration to zero
            account.Time_Out_Duration = 0;

            //Update user information with new data
            UserInfoClasses.UpdateAccount(account);

            return("No");
        }
コード例 #3
0
        // Methods that activate on the MessageReceived event.
        public static Task Nav_Time_Weather_Main_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();

            // Create an empty string variable. This is where the API request will be stored.
            string json_location = "";

            // Encapsulate the API request in a try-catch block. If the user inputs an invalid parameter, an exception will be thrown.
            try
            {
                // Make an API request with the account key and user input as parameters.
                using (WebClient client = new WebClient())
                {
                    json_location = client.DownloadString($"http://api.weatherapi.com/v1/current.json?key={WeatherAPIConfig.weather_api_account.accountKey}&q={input_string}");
                }
            }
            catch (Exception ex)
            {
                // Write the exception to the console.
                Console.WriteLine(ex);

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

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

            // Deserialize the JSON object and store it in a variable.
            var dataObject = JsonConvert.DeserializeObject <dynamic>(json_location);

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

            // Check if the location name contains any part of the user's input string.
            // The lowercase forms are compared to check for this match.
            if (dataObject.location.name.ToString().ToLower().Contains(input_string.ToLower()))
            {
                // If so, assign the proper location name to the user's account.
                account.City = $"{dataObject.location.name.ToString()}";
            }
            // If not, assign the user's input to their account settings.
            else
            {
                account.City = 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.
            _ = Time_Weather_Menu.Time_Weather_Confirm(menuSession.User, menuSession.MenuMessage);
            return(Task.CompletedTask);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public static Task Nav_Backgrounds_Upload_Settings(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_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.Setting_BG_Upload = "Maintain Aspect Ratio";

                //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_Upload_Settings_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.Setting_BG_Upload = "Stretch to Fit";

                //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_Upload_Settings_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
コード例 #6
0
        public static Task Nav_Template_Layout_P3F_Navigatior_Window(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_P3F_Menu.Template_Layout_P3F_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.P3F_TS_Nav = "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_P3F_Menu.Template_Layout_P3F_Navigatior_Window_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.P3F_TS_Nav = "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_P3F_Menu.Template_Layout_P3F_Navigatior_Window_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
コード例 #7
0
        public static Task Nav_Sheet_Order_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);
            }

            // 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.Setting_Sheet_Order = "Order by Outfit";

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

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

                // Go to a new menu.
                _ = Sheet_Order_Menu.Sheet_Order_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.Setting_Sheet_Order = "Order by Expression";

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

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

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

            return(Task.CompletedTask);
        }
コード例 #8
0
        public static Task Nav_Version_Control_P1(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu.
                menuSession.MenuTimer.Stop();

                // Go to a new menu.
                _ = Version_Control_Menu.Version_Control_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 version to the user's account.
                account.VC_P1 = "P1-PS1";

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

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

                // Go to a new menu.
                _ = Version_Control_Menu.Version_Control_P1_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 version to the user's account.
                account.VC_P1 = "P1-PSP";

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

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

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

            return(Task.CompletedTask);
        }
コード例 #9
0
        public static Task Nav_Resolution_Scaling_P4_PS2_Scaling_Method(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_P4_PS2_Menu.Resolution_Scaling_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_Scale = "Bicubic";

                //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_P4_PS2_Menu.Resolution_Scaling_P4_PS2_Scaling_Method_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_Scale = "Nearest Neighbor";

                //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_P4_PS2_Menu.Resolution_Scaling_P4_PS2_Scaling_Method_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
コード例 #10
0
ファイル: TimeOut.cs プロジェクト: Microjack5/social-linker
        internal static void SetTimeOut(SocketUser user, int duration)
        {
            //Get the account information of the user
            var account = UserInfoClasses.GetAccount(user);

            //Set the account's Time_Out_Start to the time this is called and set the duration to the given parameter
            account.Time_Out_Start    = DateTime.UtcNow;
            account.Time_Out_Duration = duration;

            //Update user information with new data
            UserInfoClasses.UpdateAccount(account);
        }
コード例 #11
0
        public static Task Nav_Star_Level_Check(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 == "⭐" || reaction.Emote.Name == "🌟" || reaction.Emote.Name == "✨")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // If the user is below Star Level Rank 2, reset their level and total EXP to their base values.
                if (account.Level_Resets < 2)
                {
                    account.Level     = 1;
                    account.Total_Exp = 0;
                }

                // If the user is currently at Star Level Rank 2, max out their P-Medal value.
                if (account.Level_Resets == 2)
                {
                    account.P_Medals = 999;
                }

                // Increase the user's level reset value by 1.
                account.Level_Resets += 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.
                _ = Star_Level_Menu.Star_Level_Confirm(menuSession.User, menuSession.MenuMessage);

                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
コード例 #12
0
        // 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);
        }
コード例 #13
0
        public static Task Nav_ShopDecorPreview(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

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

            // If the user reacts with the checkmark emote, it's time to purchase the décor!
            else if (reaction.Emote.Name == "✅")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // 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);

                // Get the information of the chosen décor index.
                var decor_info = DecorInfoMethods.GetDecorInfo(itemSession.SelectedItem);

                // If the user has not maxed out their Star Level rank, deduct the cost of the purchased décor from the user's P-Medal value.
                if (account.Level_Resets < 3)
                {
                    account.P_Medals -= decor_info.Price;
                }

                // Add the purchased item to the user's list of owned décor.
                account.Decor_Owned += $"{itemSession.SelectedItem};";

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

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

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

            return(Task.CompletedTask);
        }
コード例 #14
0
        internal static void AllRanksMaxedCheck(SocketMessage message)
        {
            var user = message.Author;

            var account = UserInfoClasses.GetAccount(user);

            // Check if all three social stats have reached rank 5 and the user hasn't received a notification acknowledging it yet.
            // Also check if the user's account is actiated, has a profile theme set, and has notifications set to on.
            if ((account.Proficiency_Rank == 5 && account.Diligence_Rank == 5 && account.Expression_Rank == 5) && account.All_Ranks_Maxed_Msg_Sent == "No" &&
                account.Account_Activated == "Yes" && account.Profile_Theme != "" && account.Rank_Up_Notifications == "On")
            {
                // If all these conditions are fulfilled, send a notification to the user notifying them that all three social stats are maxed.
                AllRanksMaxedMessage(message);

                // Set the All_Ranks_Maxed_Msg_Sent field to "yes" after the message is sent.
                account.All_Ranks_Maxed_Msg_Sent = "Yes";

                // Update user information with new data.
                UserInfoClasses.UpdateAccount(account);
            }
        }
コード例 #15
0
        public static Task Nav_Set_Decor_Preview(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);
            }

            // If the user reacts with the checkmark emote, it's time to set the décor!
            else if (reaction.Emote.Name == "✅")
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // 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);

                // Change the user's Decor_Setting setting to the SelectedItem.
                account.Decor_Setting = itemSession.SelectedItem;

                // 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);
        }
コード例 #16
0
        public static Task Nav_Template_Layout_P5S_Location_Icon(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_P5S_Menu.Template_Layout_P5S_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.P5S_TS_Location_Icon = "Yongen-Jaya";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_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.P5S_TS_Location_Icon = "Shibuya";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_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.P5S_TS_Location_Icon = "Sendai";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_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.P5S_TS_Location_Icon = "Sapporo";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_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.P5S_TS_Location_Icon = "Okinawa";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_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.P5S_TS_Location_Icon = "Fukuoka";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_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 setting to the user's account.
                account.P5S_TS_Location_Icon = "Kyoto";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_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 setting to the user's account.
                account.P5S_TS_Location_Icon = "Osaka";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_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 setting to the user's account.
                account.P5S_TS_Location_Icon = "Yokohama";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_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 setting to the user's account.
                account.P5S_TS_Location_Icon = "Shiba Park";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

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

                // Assign the chosen setting to the user's account.
                account.P5S_TS_Location_Icon = "RV Travel";

                //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_P5S_Menu.Template_Layout_P5S_Location_Icon_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
コード例 #17
0
        public static Task Nav_Template_Layout_P5S_Controller_Type(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_P5S_Menu.Template_Layout_P5S_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.P5S_TS_Controller_Type = "PlayStation® 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_P5S_Menu.Template_Layout_P5S_Controller_Type_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.P5S_TS_Controller_Type = "Nintendo 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_P5S_Menu.Template_Layout_P5S_Controller_Type_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.P5S_TS_Controller_Type = "Xbox One";

                //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_P5S_Menu.Template_Layout_P5S_Controller_Type_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.P5S_TS_Controller_Type = "Keyboard";

                //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_P5S_Menu.Template_Layout_P5S_Controller_Type_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
コード例 #18
0
        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);
        }
コード例 #19
0
        internal static void UserSentMessage(SocketMessage message)
        {
            // Get the account information of the message's author.
            var      account      = UserInfoClasses.GetAccount(message.Author);
            DateTime current_time = DateTime.UtcNow;

            // If the user's message cooldown has not passed a minute, ignore their message.
            TimeSpan time_since_last_message = (TimeSpan)(current_time - account.Last_Message_Cooldown);

            if (time_since_last_message.TotalSeconds < 60)
            {
                //Keep in case of debugging.
                //Console.WriteLine($"Seconds since last counted message: {time_since_last_message.TotalSeconds}");

                return;
            }

            // If the daily loop point has not passed and the daily EXP cap has been reached, ignore their message.
            TimeSpan time_since_last_day = (TimeSpan)(current_time - account.Loop_Point_Day);

            if ((time_since_last_day.TotalHours < 24) && (account.Daily_Exp_Gained >= 24000))
            {
                //Keep in case of debugging.
                //Console.WriteLine($"Daily EXP cap reached.");

                return;
            }

            // If the hourly loop point has not passed and the hourly EXP cap has already been reached, ignore their message.
            TimeSpan time_since_last_hour = (TimeSpan)(current_time - account.Loop_Point_Hour);

            if ((time_since_last_hour.TotalHours < 1) && (account.Hourly_Exp_Gained >= 1200))
            {
                //Keep in case of debugging.
                //Console.WriteLine($"Hourly EXP cap reached.");

                return;
            }
            // If the hourly loop point has passed, reset the hourly parameters.
            else if (time_since_last_hour.TotalHours >= 1)
            {
                account.Loop_Point_Hour   = current_time;
                account.Hourly_Exp_Gained = 0;
            }

            // Determine if the user is currently in a Tired state.
            // If the Hourly_Cap_Counter is 12 and 8 hours have not passed yet, Tired state is active.
            if (account.Hourly_Cap_Counter == 12 && time_since_last_day.TotalHours < 8)
            {
                // Do nothing
            }
            // If the Hourly_Cap_Counter is 12 and 8 hours have passed, reset the counters.
            else if (account.Hourly_Cap_Counter == 12 && time_since_last_day.TotalHours >= 8)
            {
                account.Hourly_Cap_Counter = 0;
                account.Loop_Point_Day     = current_time;
                account.Daily_Exp_Gained   = 0;
            }

            // Determine if the user is currently in a Sick state.
            // If the Hourly_Cap_Counter is more than 12 and 24 hours have not passed yet, Sick state is active.
            if (account.Hourly_Cap_Counter > 12 && time_since_last_day.TotalHours < 24)
            {
                // Do nothing
            }
            // If the Hourly_Cap_Counter is more than 12 and 24 hours have passed, reset the counters.
            else if (account.Hourly_Cap_Counter > 12 && time_since_last_day.TotalHours >= 24)
            {
                account.Hourly_Cap_Counter = 0;
                account.Loop_Point_Day     = current_time;
                account.Daily_Exp_Gained   = 0;
            }

            // If the user is in a normal state, reset the counters after a day has passed.
            if (account.Hourly_Cap_Counter < 12 && time_since_last_day.TotalHours >= 24)
            {
                account.Hourly_Cap_Counter = 0;
                account.Loop_Point_Day     = current_time;
                account.Daily_Exp_Gained   = 0;
            }

            // Calculate the amount of EXP the user should earn from this message.
            int gained_exp = CalculateExpEarned(message);

            //Before overwriting the user's total EXP value, store the old one
            int old_exp = account.Total_Exp;

            // Store the new EXP total in both Total_EXP and Hourly_Exp_Gained fields.
            // If the user has reached Level 99, no more EXP is added to their account and the function returns.
            if (account.Level == 99)
            {
                // Do nothing
                return;
            }
            // If the hourly EXP cap has been reached 12 times, the user earns half EXP.
            else if (account.Hourly_Cap_Counter == 12)
            {
                account.Total_Exp         += gained_exp / 2;
                account.Hourly_Exp_Gained += gained_exp / 2;
                account.Daily_Exp_Gained  += gained_exp / 2;
            }
            // If the hourly EXP cap has been reached more than 12 times, the user earns 1 EXP.
            else if (account.Hourly_Cap_Counter > 12)
            {
                account.Total_Exp         += 1;
                account.Hourly_Exp_Gained += 1;
                account.Daily_Exp_Gained  += 1;
            }
            else
            {
                account.Total_Exp         += gained_exp;
                account.Hourly_Exp_Gained += gained_exp;
                account.Daily_Exp_Gained  += gained_exp;
            }

            // Determine what level the user is at now.
            int oldLevel = account.Level;
            int newLevel = CalculateLevel(account.Total_Exp);

            // Compare oldLevel to newLevel. If the values are different, the user leveled up.
            if (oldLevel != newLevel)
            {
                // If newLevel is less than 10, override previous stored value and cap EXP at the start of the next level.
                if (newLevel < 10)
                {
                    newLevel          = oldLevel + 1;
                    account.Total_Exp = CalculateExp(newLevel);
                }

                // Update the user's level with newLevel.
                account.Level = newLevel;

                // Calculate the amount of P-Medals the user gains on level up.
                // Social Bonus is the amount of P-Medals affected by the user's social stats.
                int social_bonus   = (account.Proficiency_Rank - 1) + (account.Diligence_Rank - 1) + (account.Expression_Rank - 1);
                int gained_pmedals = ((newLevel / 100) * social_bonus) + (social_bonus) + 1;

                // Calculate the amount of P-Medals the user keeps before reaching the P-Medal cap.
                gained_pmedals    = CalculateMedalsKept(message, gained_pmedals);
                account.P_Medals += gained_pmedals;

                // If the user's account is actiated, has a profile theme set, and has notifications set to on, send a level up message.
                if (account.Account_Activated == "Yes" && account.Profile_Theme != "" && account.Level_Up_Notifications == "On")
                {
                    LevelUpMessage(message, newLevel, gained_pmedals);

                    // If this is the first time the user is receiving a level up message, set the First_Level_Msg_Sent field to "yes" after the message is sent.
                    if (account.First_Level_Msg_Sent == "No")
                    {
                        account.First_Level_Msg_Sent = "Yes";
                    }
                }

                // If the user has leveled up to Level 99 for the first time, activated their account, has a profile theme set, and has notifications set to on, send a notification.
                if (newLevel == 99 && account.Account_Activated == "Yes" && account.Profile_Theme != "" && account.Level_Up_Notifications == "On")
                {
                    MaxLevelMessage(message);
                }
            }

            // Check if 75% of the hourly EXP cap has been reached with this message.
            if (old_exp < 4500 && account.Hourly_Exp_Gained >= 4500)
            {
                // If old_exp was below the threshhold and EXP gained in the hour is above the threshhold, increase the Hourly_Cap_Counter.
                account.Hourly_Cap_Counter += 1;

                // If Hourly_Cap_Counter has reached 12, set the Loop_Point_Day to the current time. The user has either entered a "Tired" or "Sick" state.
                if (account.Hourly_Cap_Counter >= 12)
                {
                    account.Loop_Point_Day = current_time;
                }
            }

            // Create a new message cooldown from this point.
            account.Last_Message_Cooldown = current_time;

            // Update user information with new data.
            UserInfoClasses.UpdateAccount(account);
        }
コード例 #20
0
        // 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);
        }
コード例 #21
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);
        }
コード例 #22
0
        internal static void AddExpression(SocketMessage message, SocketUser user)
        {
            var      account      = UserInfoClasses.GetAccount(user);
            DateTime current_time = DateTime.UtcNow;

            // Create a variable for max Expression value.
            int max_expression = SocialStatRanks.expression_rank_5_max;

            // If the daily loop point has not passed and the daily Expression cap has been reached, skip this step.
            TimeSpan time_since_last_day = (TimeSpan)(current_time - account.Loop_Point_Day);

            if ((time_since_last_day.TotalHours < 24) && (account.Daily_Expression_Gained >= 10))
            {
                return;
            }
            // If the daily loop point has passed, reset the daily parameter.
            else if (time_since_last_day.TotalHours >= 24)
            {
                account.Daily_Expression_Gained = 0;
            }

            // If the user has already reached the Expression cap, return the function.
            if (account.Expression == max_expression)
            {
                return;
            }

            // Add Expression to user account.
            account.Expression += 2;
            account.Daily_Expression_Gained += 2;

            // Check if the user has crossed the Expression cap. If so, set Expression exactly at the cap.
            if (account.Expression > max_expression)
            {
                account.Expression = max_expression;
            }

            // Establish variables for keeping track of the user's rank before and after adding Expression.
            int old_rank = account.Expression_Rank;
            int new_rank = CalculateExpressionRank(account.Expression);

            // Compare old_rank to new_rank. If the values are different, the user ranked up.
            if (old_rank != new_rank)
            {
                // Replace previous stored value with new one.
                account.Expression_Rank = new_rank;

                // If the user's account is actiated, has a profile theme set, and has notifications set to on, send a rank up message.
                if (account.Account_Activated == "Yes" && account.Profile_Theme != "" && account.Rank_Up_Notifications == "On")
                {
                    ExpressionRankUpMessage(message, new_rank);

                    // If this is the first time the user is receiving a rank up message, set the First_Rank_Msg_Sent field to "yes" after the message is sent.
                    if (account.First_Rank_Msg_Sent == "No")
                    {
                        account.First_Rank_Msg_Sent = "Yes";
                    }
                }
            }

            // Update user information with new data.
            UserInfoClasses.UpdateAccount(account);

            // Check if the user has maxed out all social stats.
            AllRanksMaxedCheck(message);
        }
コード例 #23
0
        internal static void AddDiligence(SocketMessage message)
        {
            var      account      = UserInfoClasses.GetAccount(message.Author);
            DateTime current_time = DateTime.UtcNow;

            // Create a variable for max Diligence value.
            int max_diligence = SocialStatRanks.diligence_rank_5_max;

            // If the daily loop point has not passed and the daily Diligence cap has been reached, return.
            TimeSpan time_since_last_day = (TimeSpan)(current_time - account.Loop_Point_Day);

            if ((time_since_last_day.TotalHours < 24) && (account.Daily_Diligence_Gained == "Yes"))
            {
                return;
            }
            // If the amount of time that has passed is between 24 and 48 hours since the daily loop point, reset the daily parameter.
            else if ((time_since_last_day.TotalHours >= 24) && (time_since_last_day.TotalHours <= 48))
            {
                account.Daily_Diligence_Gained = "No";
            }
            // If the amount of time that has passed is over 48 hours, set the Diligence multiplier back to 10, add a P-Medal, then return. The user does not gain Diligence for the day.
            else if (time_since_last_day.TotalHours > 48)
            {
                account.Diligence_Multiplier = 10;
                account.P_Medals            += 1;
                return;
            }

            // If the user has already reached the Diligence cap, return the function.
            if (account.Diligence == max_diligence)
            {
                return;
            }

            // Add Diligence and a P-Medal to the user, then set the daily cap value.
            account.Diligence += account.Diligence_Multiplier;

            // Calculate the amount of P-Medals the user keeps before reaching the P-Medal cap.
            account.P_Medals += LevelSystem.Leveling.CalculateMedalsKept(message, 1);

            // Daily_Diligence_Gained is set to "yes" to signify the day has been counted for any amount.
            account.Daily_Diligence_Gained = "Yes";

            // Increase the Diligence multiplier for the next day if its cap hasn't been reached.
            if (account.Diligence_Multiplier < 20)
            {
                account.Diligence_Multiplier += 1;
            }

            // Check if the user has crossed the Diligence cap. If so, set Diligence exactly at the cap.
            if (account.Diligence > max_diligence)
            {
                account.Diligence = max_diligence;
            }

            // Establish variables for keeping track of the user's rank before and after adding Diligence.
            int old_rank = account.Diligence_Rank;
            int new_rank = CalculateDiligenceRank(account.Diligence);

            // Compare old_rank to new_rank. If the values are different, the user ranked up.
            if (old_rank != new_rank)
            {
                // Replace previous stored value with new one.
                account.Diligence_Rank = new_rank;

                // If the user's account is actiated, has a profile theme set, and has notifications set to on, send a rank up message.
                if (account.Account_Activated == "Yes" && account.Profile_Theme != "" && account.Rank_Up_Notifications == "On")
                {
                    DiligenceRankUpMessage(message, new_rank);

                    // If this is the first time the user is receiving a rank up message, set the First_Rank_Msg_Sent field to "yes" after the message is sent.
                    if (account.First_Rank_Msg_Sent == "No")
                    {
                        account.First_Rank_Msg_Sent = "Yes";
                    }
                }
            }

            //Update user information with new data
            UserInfoClasses.UpdateAccount(account);

            //Check if the user has maxed out all social stats.
            AllRanksMaxedCheck(message);
        }
コード例 #24
0
        public static Task Nav_Template_Layout_P4D_Dual_Character(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_P4D_Menu.Template_Layout_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_TS_Dual = "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_P4D_Menu.Template_Layout_P4D_Dual_Character_Default_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_TS_Dual = "Navigator";

                //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_P4D_Menu.Template_Layout_P4D_Dual_Character_Navigator_Caller_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.P4D_TS_Dual = "Phone Call";

                //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_P4D_Menu.Template_Layout_P4D_Dual_Character_Navigator_Caller_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
コード例 #25
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);
        }
コード例 #26
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);
        }
コード例 #27
0
        public static Task Nav_ShopSort(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

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

            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3") // Keycap one
            {
                // 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
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3") // Keycap two
            {
                // 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
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0033\ufe0f\u20e3") // Keycap three
            {
                // 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
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0034\ufe0f\u20e3") // Keycap four
            {
                // 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
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0035\ufe0f\u20e3") // Keycap five
            {
                // 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
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0036\ufe0f\u20e3") // Keycap six
            {
                // 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
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
コード例 #28
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);
        }
コード例 #29
0
        public static Task Nav_Template_Layout_P5_PS3_Panel_Advance(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_P5_PS3_Menu.Template_Layout_P5_PS3_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.P5_PS4_TS_Panel = "Manual";

                //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_P5_PS3_Menu.Template_Layout_P5_PS3_Panel_Advance_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.P5_PS4_TS_Panel = "Auto-advance";

                //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_P5_PS3_Menu.Template_Layout_P5_PS3_Panel_Advance_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.P5_PS4_TS_Panel = "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_P5_PS3_Menu.Template_Layout_P5_PS3_Panel_Advance_Confirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
コード例 #30
0
        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);
        }