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); }
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); }
public static Task Nav_Backgrounds_Default_Color_Error(SocketReaction reaction, MenuIdStructure menuSession) { if (reaction.Emote.Name == "↩️") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Backgrounds_Menu.Backgrounds_Default_Color(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } return(Task.CompletedTask); }
// Methods that activate on the MessageReceived event. public static Task Nav_Backgrounds_Default_Color_Message_Received(SocketMessage message, MenuIdStructure menuSession) { // Store the text of the message in a string and convert all letters to uppercase. string input_string = message.Content.ToUpper(); // Take a substring consisting of the first character of the input string. string first_char = input_string.Substring(0, 1); // If the first character is not the pound symbol, add it to the beginning of the input string. if (first_char != "#") { input_string = "#" + input_string; } // Check if the input string is a valid HTML color. if (CheckValidFormatHtmlColor(input_string) == true) { // Get the account information of the user. var account = UserInfoClasses.GetAccount(menuSession.User); // Assign the chosen setting to the user's account. account.Setting_BG_Color = input_string; //Update the user's account. UserInfoClasses.UpdateAccount(account); // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Backgrounds_Menu.Backgrounds_Default_Color_Confirm(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } // If the input string is not a valid HTML color, go to an error menu. else if (CheckValidFormatHtmlColor(input_string) == false) { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Backgrounds_Menu.Backgrounds_Default_Color_Error(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } return(Task.CompletedTask); }
public static Task Nav_Backgrounds_Upload_Settings_Confirm(SocketReaction reaction, MenuIdStructure menuSession) { if (reaction.Emote.Name == "💠") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Backgrounds_Menu.Backgrounds_Main(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } else if (reaction.Emote.Name == "❌") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Attempt to delete the menu message from the channel if it hasn't been deleted by the user yet. If this fails, catch the exception. try { _ = menuSession.MenuMessage.DeleteAsync(); } catch (Exception ex) { Console.WriteLine(ex); } // If the menu session is not null, remove it from the global list. if (menuSession != null) { Global.MenuIdList.Remove(menuSession); } return(Task.CompletedTask); } return(Task.CompletedTask); }
// Methods that activate on the ReactionAdded event. public static Task Nav_Backgrounds_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") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Backgrounds_Menu.Backgrounds_Default_Color(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } // 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. _ = Backgrounds_Menu.Backgrounds_Upload_Settings(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } return(Task.CompletedTask); }
public static Task Nav_SM_Settings_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. _ = Settings_Menu.Settings_Main_Menu(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } // Keycap One else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Version_Control_Menu.Version_Control_Main(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } // Keycap Two else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Template_Layout_Menu.Template_Layout_Main(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } // Keycap Three else if (reaction.Emote.Name == "\u0033\ufe0f\u20e3") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. // [Insert method here] 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. // [Insert method here] 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. _ = Sheet_Order_Menu.Sheet_Order_Main(menuSession.User, menuSession.MenuMessage); 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. _ = Backgrounds_Menu.Backgrounds_Main(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } // Keycap Seven else if (reaction.Emote.Name == "\u0037\ufe0f\u20e3") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Resolution_Scaling_Menu.Resolution_Scaling_Main(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } // Keycap Eight else if (reaction.Emote.Name == "\u0038\ufe0f\u20e3") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Auto_Delete_Menu.Auto_Delete_Main(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } return(Task.CompletedTask); }