public static Task Nav_Resolution_Scaling_P1_PSP_Output_Resolution(SocketReaction reaction, MenuIdStructure menuSession) { if (reaction.Emote.Name == "↩️") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Resolution_Scaling_P1_PSP_Menu.Resolution_Scaling_P1_PSP_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_PSP_Resolution = "480 × 272"; //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_P1_PSP_Menu.Resolution_Scaling_P1_PSP_Output_Resolution_Confirm(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } // Keycap Two else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3") { // Get the account information of the user. var account = UserInfoClasses.GetAccount(menuSession.User); // Assign the chosen setting to the user's account. account.P1_PSP_Resolution = "1920 × 1088"; //Update the user's account. UserInfoClasses.UpdateAccount(account); // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Resolution_Scaling_P1_PSP_Menu.Resolution_Scaling_P1_PSP_Output_Resolution_Confirm(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } return(Task.CompletedTask); }
public static Task Nav_Template_Layout_P2EP_PS1_Inverted_Filter(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_P2EP_PS1_Menu.Template_Layout_P2EP_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.P2EP_PSX_TS_Invert = "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_P2EP_PS1_Menu.Template_Layout_P2EP_PS1_Inverted_Filter_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.P2EP_PSX_TS_Invert = "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_P2EP_PS1_Menu.Template_Layout_P2EP_PS1_Inverted_Filter_Confirm(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } return(Task.CompletedTask); }
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); }
public static Task Nav_Template_Layout_P5R_Phone_Calls_Location(SocketReaction reaction, MenuIdStructure menuSession) { if (reaction.Emote.Name == "↩️") { // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Template_Layout_P5R_Menu.Template_Layout_P5R_Phone_Calls_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.P5R_TS_Caller_Location = "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_P5R_Menu.Template_Layout_P5R_Phone_Calls_Location_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.P5R_TS_Caller_Location = "Velvet Room"; //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_P5R_Menu.Template_Layout_P5R_Phone_Calls_Location_Confirm(menuSession.User, menuSession.MenuMessage); } return(Task.CompletedTask); }
public static async Task Settings_Start(SocketTextChannel channel, SocketGuildUser user) { //Get the account information of the command's target var account = UserInfoClasses.GetAccount(user); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Now Loading...", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); //Determine color for embeded message embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); // Create a null variable for the message. RestUserMessage message = null; // Try to send a message to the channel. If the bot lacks permissions, catch the exception and return. try { message = await channel.SendMessageAsync("", false, embed.Build()); } catch (Exception ex) { Console.WriteLine(ex); return; } // Create a new menu identifier entry for this current message and user to keep track of the overall menu status. var menuSession = new MenuIdStructure() { User = user, MenuMessage = message, CurrentMenu = "Settings_Start", MenuTimer = new Timer() { // Create a timer that expires as a "time out" duration for the user. Interval = MenuConfig.menu.timerDuration, AutoReset = false, Enabled = true } }; // Add the menu entry to the global list. Global.MenuIdList.Add(menuSession); // Create a new menu in the current channel. await Settings_Main_Menu(menuSession.User, menuSession.MenuMessage); }
public static async Task ContentCheck(SocialLinkerCommand command) { // If there is a cooldown session active for the command type "status", return the method immediately. if (await UserCooldownMethods.IsCooldownActive(command, "status") == true) { return; } // Get the account information of the command's user. var command_user_account = UserInfoClasses.GetAccount(command.User); // Check if the user's account has been activated. If not, send them to the initial usage setup menu. if (command_user_account.Account_Activated == "No") { await First_Use_Content_Filter_Menu.First_Use_Content_Filter_Start((SocketTextChannel)command.Channel, (SocketGuildUser)command.User); return; } // End of initial usage and cooldown checks. Status status_object = new Status(); switch (command.CommandType) { case "Slash": switch (command.CommandName) { case "status": await status_object.StatusScreen(command); break; case "status_text": break; } break; case "Context": if (command.Message.Content.ToLower().Contains("detail")) { await status_object.StatusDetails(command); } else { await status_object.StatusScreen(command); } break; } }
internal static async void MaxLevelMessage(SocketMessage message) { var user = message.Author; var channel = message.Channel; var account = UserInfoClasses.GetAccount(user); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "MAX LEVEL!!", IconUrl = user.GetAvatarUrl() }; // Determine color for embeded message. if (account.Profile_Theme == "P3") { embed.WithColor(37, 149, 255); embed.WithThumbnailUrl("https://i.imgur.com/CguM1ql.png"); } else if (account.Profile_Theme == "P4") { embed.WithColor(255, 229, 49); embed.WithThumbnailUrl("https://i.imgur.com/PW7VtuB.png"); } else if (account.Profile_Theme == "P5") { embed.WithColor(213, 27, 4); embed.WithThumbnailUrl("https://i.imgur.com/tubdL8K.png"); } embed.WithAuthor(author); // If the user has reset their level before, display a message for current Star Level users depending on how many times their level has been reset. if (account.Level_Resets == 2) { embed.WithDescription($"You've reached Level 99 three times! The option **Star Level** has reappeared for the final time in the **`{BotConfig.bot.cmdPrefix}settings`** menu under [Profile Settings]."); } else if (account.Level_Resets == 1) { embed.WithDescription($"You've reached Level 99 twice! The option **Star Level** has reappeared in the **`{BotConfig.bot.cmdPrefix}settings`** menu under [Profile Settings]."); } // If not, introduce the concept of Star Levels to the user. else if (account.Level_Resets == 0) { embed.WithDescription($"You've reached Level 99! A new option called **Star Level** has been unlocked in the **`{BotConfig.bot.cmdPrefix}settings`** menu under [Profile Settings]."); } await channel.SendMessageAsync("", false, embed.Build()); }
public static string GetDecorTitle(SocketUser user) { // Get the account information of the command's user. var account = UserInfoClasses.GetAccount(user); // Create an empty string variable. This will hold the title of the user's currently set décor. string set_decor_title = ""; // Determine what the title will be based on the user's set décor and profile theme. // First, check if the user has a décor currently set. if (account.Decor_Setting != "") { // Get the information of the currently set décor. var decor_info = DecorInfoMethods.GetDecorInfo(account.Decor_Setting); // Set the string variable to the title of the user's set décor. set_decor_title = decor_info.Title; } // Else, check if the user has a profile theme currently set. else if (account.Profile_Theme != "") { // Create another empty string variable. string game_title = ""; // Form a full title based on the user's profile theme and assign it to the string variable. if (account.Profile_Theme == "P3") { game_title = "Persona 3"; } else if (account.Profile_Theme == "P4") { game_title = "Persona 4"; } else if (account.Profile_Theme == "P5") { game_title = "Persona 5"; } // Use the initial empty string variable created and assign the full game title to it, alongside describing it as a décor. set_decor_title = $"{game_title} Décor"; } // If the user neither has a set décor or profile theme, the title will be "None". else { set_decor_title = "None"; } return(set_decor_title); }
public static EmbedBuilder CooldownEmbed(SocketUser user, int time_remaining) { // Grab the user's account information. var account = UserInfoClasses.GetAccount(user); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Command Cooldown", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); // Determine the color and thumbnail for the embeded message. if (account.Profile_Theme == "P3") { embed.WithColor(37, 149, 255); embed.WithThumbnailUrl("https://i.imgur.com/CguM1ql.png"); } else if (account.Profile_Theme == "P4") { embed.WithColor(255, 229, 49); embed.WithThumbnailUrl("https://i.imgur.com/PW7VtuB.png"); } else if (account.Profile_Theme == "P5") { embed.WithColor(213, 27, 4); embed.WithThumbnailUrl("https://i.imgur.com/tubdL8K.png"); } // Change the embeded description depending on how much time is remaining. if (time_remaining == 0) { embed.WithDescription($"Please wait a moment to use this command again."); } else if (time_remaining == 1) { embed.WithDescription($"Please wait {time_remaining} second to use this command again."); } else { embed.WithDescription($"Please wait {time_remaining} seconds to use this command again."); } return(embed); }
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); }
public static Bitmap RenderProgressBar(SocketUser user) { // Grab the user's account information var account = UserInfoClasses.GetAccount(user); // Establish other variables of the user's data int total_exp = account.Total_Exp; // Create a working space bitmap Bitmap new_bitmap = new Bitmap(1920, 1080); // Use a graphics object to edit the bitmap using (Graphics graphics = Graphics.FromImage(new_bitmap)) { // Create a variable for the minimum total EXP requirement of the next level int next_level_total_exp_required = Core.LevelSystem.Leveling.CalculateExp(account.Level + 1); // Create a variable for the minimum total EXP requirement of the current level int current_level_total_exp_required = Core.LevelSystem.Leveling.CalculateExp(account.Level); // Draw a progress bar that has a max value set to the minimum total EXP requirement of the next level minus the minimum total EXP requirement of the current level ProgressBar progress_bar = new ProgressBar(System.Drawing.Brushes.Yellow, new Rectangle(496, 684, 416, 37), next_level_total_exp_required - current_level_total_exp_required); // However, if the user's level is 99, set the progress bar's max value to 1 if (account.Level == 99) { progress_bar = new ProgressBar(System.Drawing.Brushes.Yellow, new Rectangle(496, 684, 416, 37), 1); } // Determine how the progress bar should be filled based on the user's level if (account.Level != 99) { // If the level is below 99, fill the progress bar by subtracting the total EXP the user has by the minimum total EXP requirement of the current level progress_bar.SetCurrent(total_exp - current_level_total_exp_required); } else { // If the level is at 99, fill the progress bar completely up progress_bar.SetCurrent(1); } // Draw the progress bar to the bitmap graphics.DrawImage(progress_bar.GiveGraphic(), progress_bar.GiveCorner()); } return(new_bitmap); }
// 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 EmbedBuilder MenuTimedOut(SocketGuildUser user) { // Get the account information of the command's target var account = UserInfoClasses.GetAccount(user); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Inactive Menu", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); embed.WithDescription("Use a Social Linker command again to set up your first time usage settings."); return(embed); }
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); }
internal static int CalculateMedalsKept(SocketMessage message, int gained_pmedals) { var account = UserInfoClasses.GetAccount(message.Author); int amount_kept = 0; // If the amount of P-Medals gained is greater than the max amount the user can hold, return only what will bring the user to the cap. if (gained_pmedals > (999 - account.P_Medals)) { amount_kept = 999 - account.P_Medals; } // If not, return all the P-Medals gained. else { amount_kept = gained_pmedals; } return(amount_kept); }
public static EmbedBuilder MenuTimedOut(SocketGuildUser user) { // Get the account information of the command's target var account = UserInfoClasses.GetAccount(user); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Inactive Menu", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); // Determine the color and thumbnail for the embeded message embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Help_Thumbnail(account)); embed.WithDescription($"You can adjust your template settings at any time from the **`{BotConfig.bot.cmdPrefix}settings`** menu by choosing [Scene Maker Settings] > [Template Layout]."); return(embed); }
public static EmbedBuilder MenuTimedOut(SocketGuildUser user) { // Get the account information of the command's target var account = UserInfoClasses.GetAccount(user); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Inactive Menu", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); // Determine the color and thumbnail for the embeded message embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Help_Thumbnail(account)); embed.WithDescription($"You can access the help menu at any time with the **`{BotConfig.bot.cmdPrefix}help`** command."); return(embed); }
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); } }
public static async void HugBot(SocketMessage message) { var user = message.Author; var channel = message.Channel; var account = UserInfoClasses.GetAccount(user); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Social Linker loves you!", IconUrl = user.GetAvatarUrl() }; //Determine color for embeded message embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithAuthor(author); embed.WithDescription("❤️ ❤️ ❤️ ❤️ ❤️"); await channel.SendMessageAsync("", false, embed.Build()); }
public static async void SlapSelf(SocketMessage message) { var user = message.Author; var channel = message.Channel; //Retrieve the account information of the command's user var account = UserInfoClasses.GetAccount(user); //Create an embeded message and declare the title var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = $"Oh no! Social Linker gave {user.Username} a hug instead.", IconUrl = user.GetAvatarUrl() }; //Determine color for embeded message if (account.Profile_Theme == "P3") { embed.WithColor(37, 149, 255); } else if (account.Profile_Theme == "P4") { embed.WithColor(255, 229, 49); } else if (account.Profile_Theme == "P5") { embed.WithColor(213, 27, 4); } embed.WithAuthor(author); if (account.Profile_Theme != "") { embed.WithImageUrl($"{Commands.Hug.RandomizeHugGif(user, user)}"); } await channel.SendMessageAsync("", false, embed.Build()); }
public static async void SlapError(SocketMessage message) { var user = message.Author; var channel = message.Channel; //Retrieve the account information of the command's user var account = UserInfoClasses.GetAccount(user); //Create an embeded message and declare the title var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Social Command: Slap", IconUrl = user.GetAvatarUrl() }; //Determine color for embeded message if (account.Profile_Theme == "P3") { embed.WithColor(37, 149, 255); embed.WithThumbnailUrl("https://i.imgur.com/CguM1ql.png"); } else if (account.Profile_Theme == "P4") { embed.WithColor(255, 229, 49); embed.WithThumbnailUrl("https://i.imgur.com/PW7VtuB.png"); } else if (account.Profile_Theme == "P5") { embed.WithColor(213, 27, 4); embed.WithThumbnailUrl("https://i.imgur.com/tubdL8K.png"); } embed.WithAuthor(author); embed.WithDescription("Mention a user while using this command to slap them."); await channel.SendMessageAsync("", false, embed.Build()); }
public static async Task MakerCommandParser(SocialLinkerCommand sl_command) { // If there is a cooldown session active for the command type "scene", return the method immediately. if (await UserCooldownMethods.IsCooldownActive(sl_command, "scene") == true) { return; } // Get the account information of the command's user. var command_user_account = UserInfoClasses.GetAccount(sl_command.User); // Check if the user's account has been activated. If not, send them to the initial usage setup menu. if (command_user_account.Account_Activated == "No") { await First_Use_Content_Filter_Menu.First_Use_Content_Filter_Start((SocketTextChannel)sl_command.Channel, (SocketGuildUser)sl_command.User); return; } // End of initial usage and cooldown checks. await CommandParser.Type_Directory(sl_command); }
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); }
internal static async void AllRanksMaxedMessage(SocketMessage message) { var user = message.Author; var channel = message.Channel; var account = UserInfoClasses.GetAccount(user); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "ALL RANKS MAXED!!", IconUrl = user.GetAvatarUrl() }; //Determine color for embeded message if (account.Profile_Theme == "P3") { embed.WithColor(37, 149, 255); embed.WithThumbnailUrl("https://i.imgur.com/CguM1ql.png"); } else if (account.Profile_Theme == "P4") { embed.WithColor(255, 229, 49); embed.WithThumbnailUrl("https://i.imgur.com/PW7VtuB.png"); } else if (account.Profile_Theme == "P5") { embed.WithColor(213, 27, 4); embed.WithThumbnailUrl("https://i.imgur.com/tubdL8K.png"); } embed.WithAuthor(author); embed.WithDescription("You've maxed out all social stats!"); await channel.SendMessageAsync("", false, embed.Build()); }
public static async Task P2IS_PS1_Set_List(SocialLinkerCommand sl_command) { // Create two variables for the command user and the command channel, derived from the message object taken in. SocketUser user = sl_command.User; SocketTextChannel channel = (SocketTextChannel)sl_command.Channel; // Get the account information of the command's user. var account = UserInfoClasses.GetAccount(user); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Persona 2: Innocent Sin (PlayStation®️) Conversation Portrait Sets", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); // Set the color and thumbnail for the embeded message. embed.WithColor(EmbedSettings.Get_Game_Color("P2IS-PS1", null)); embed.WithThumbnailUrl(EmbedSettings.Get_Game_Logo("P2IS-PS1")); // Create a description with the list of sprite sets available for the title. embed.WithDescription($"{OfficialSetMethods.Generate_Normal_Set_List("P2IS-PS1")}"); // Create a footer based on the game version the list is from. var footer = new EmbedFooterBuilder { Text = "Version: P2IS-PS1" }; // Add the footer to the embed. embed.WithFooter(footer); // Send the embeded message to the channel. await channel.SendMessageAsync("", false, embed.Build()); }
public static async void SlapBot(SocketMessage message) { var user = message.Author; var channel = message.Channel; var account = UserInfoClasses.GetAccount(user); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Ow!", IconUrl = user.GetAvatarUrl() }; //Determine color for embeded message if (account.Profile_Theme == "P3") { embed.WithColor(37, 149, 255); } else if (account.Profile_Theme == "P4") { embed.WithColor(255, 229, 49); } else if (account.Profile_Theme == "P5") { embed.WithColor(213, 27, 4); } embed.WithAuthor(author); embed.WithDescription("Social Linker needs a minute to recover..."); await channel.SendMessageAsync("", false, embed.Build()); //If the user slaps Social Linker, their messages will be ignored for 1 minute Core.LevelSystem.TimeOut.SetTimeOut(user, 1); }
public static async Task Template_Layout_P2EP_PSP_Inverted_Filter(SocketGuildUser user, RestUserMessage message) { // Get the account information of the command's user. var account = UserInfoClasses.GetAccount(user); // Find the menu session associated with the current user. var menuSession = Global.MenuIdList.SingleOrDefault(x => x.User.Id == user.Id); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Inverted Filter", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "↩️ Return to P2EP Template Settings" }; embed.WithFooter(footer); // Assign a color and thumbnail to the embeded message based on the title being edited. embed.WithColor(EmbedSettings.Get_Game_Color("P2EP-PSP", null)); embed.WithThumbnailUrl(EmbedSettings.Get_Game_Logo("P2EP-PSP")); embed.WithDescription("" + "**Toggle inverted colors for character sprites on and off.**\n" + "\n" + $"⚙️ **Current setting:** **`{account.P2EP_PSP_TS_Invert}`**\n" + "\n" + ":one: On\n" + ":two: Off\n"); // Attempt editing the message if it hasn't been deleted by the user yet. // If it has, catch the exception, remove the menu entry from the global list, and return. try { // Remove all reactions from the current message. await message.RemoveAllReactionsAsync(); // Edit the current active message by replacing it with the recently created embed. await message.ModifyAsync(x => { x.Embed = embed.Build(); }); } catch (Exception ex) { Console.WriteLine(ex); // Remove the menu entry from the global list. Global.MenuIdList.Remove(menuSession); return; } // Edit the menu session according to the current message. menuSession.CurrentMenu = "Template_Layout_P2EP_PSP_Inverted_Filter"; menuSession.MenuTimer = new Timer() { // Create a timer that expires as a "time out" duration for the user. Interval = MenuConfig.menu.timerDuration, AutoReset = false, Enabled = true }; // If the menu timer runs out, activate a function. menuSession.MenuTimer.Elapsed += (sender, e) => MenuTimer_Elapsed(sender, e, menuSession); // Create an empty list for reactions. List <IEmote> reaction_list = new List <IEmote> { }; // Add needed emote reactions for the menu. reaction_list.Add(new Emoji("↩️")); reaction_list.Add(new Emoji("\u0031\ufe0f\u20e3")); reaction_list.Add(new Emoji("\u0032\ufe0f\u20e3")); // Add the reactions to the message. _ = ReactionHandling.AddReactionsToMenu(message, reaction_list); }
public static async Task Template_Layout_P4_PS2_Date_Weather_Confirm(SocketGuildUser user, RestUserMessage message) { // Get the account information of the command's user. var account = UserInfoClasses.GetAccount(user); // Find the menu session associated with the current user. var menuSession = Global.MenuIdList.SingleOrDefault(x => x.User.Id == user.Id); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Settings Saved", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "💠 P4 Template Settings | ❌ Close Menu" }; embed.WithFooter(footer); // Assign a color and thumbnail to the embeded message based on the title being edited. embed.WithColor(EmbedSettings.Get_Game_Color("P4-PS2", null)); embed.WithThumbnailUrl(EmbedSettings.Get_Game_Logo("P4-PS2")); embed.WithDescription("" + $"The date & weather HUD has been set to **`{account.P4_PS2_TS_HUD}`**.\n"); // Attempt editing the message if it hasn't been deleted by the user yet. // If it has, catch the exception, remove the menu entry from the global list, and return. try { // Remove all reactions from the current message. await message.RemoveAllReactionsAsync(); // Edit the current active message by replacing it with the recently created embed. await message.ModifyAsync(x => { x.Embed = embed.Build(); }); } catch (Exception ex) { Console.WriteLine(ex); // Remove the menu entry from the global list. Global.MenuIdList.Remove(menuSession); return; } // Edit the menu session according to the current message. menuSession.CurrentMenu = "Template_Layout_P4_PS2_Date_Weather_Confirm"; menuSession.MenuTimer = new Timer() { // Create a timer that expires as a "time out" duration for the user. Interval = MenuConfig.menu.timerDuration, AutoReset = false, Enabled = true }; // If the menu timer runs out, activate a function. menuSession.MenuTimer.Elapsed += (sender, e) => MenuTimer_Elapsed(sender, e, menuSession); // Create an empty list for reactions. List <IEmote> reaction_list = new List <IEmote> { }; // Add needed emote reactions for the menu. reaction_list.Add(new Emoji("💠")); reaction_list.Add(new Emoji("❌")); // Add the reactions to the message. _ = ReactionHandling.AddReactionsToMenu(message, reaction_list); }
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); }
public static Task Nav_Template_Layout_P3F_Date_Moon(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_HUD = "Display All"; //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_Date_Moon_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_HUD = "Countdown 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_Date_Moon_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.P3F_TS_HUD = "Date Only"; //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_Date_Moon_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.P3F_TS_HUD = "None"; //Update the user's account. UserInfoClasses.UpdateAccount(account); // Stop the timeout timer associated with the menu. menuSession.MenuTimer.Stop(); // Go to a new menu. _ = Template_Layout_P3F_Menu.Template_Layout_P3F_Date_Moon_Confirm(menuSession.User, menuSession.MenuMessage); return(Task.CompletedTask); } return(Task.CompletedTask); }