public static async void HugError(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: Hug", IconUrl = user.GetAvatarUrl() }; // 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.WithAuthor(author); embed.WithDescription("Mention a user while using this command to give them a hug."); await channel.SendMessageAsync("", false, embed.Build()); }
public static async Task Status_Decor_Exit(SocketGuildUser user, RestUserMessage message) { //Get the account information of the command's target var account = UserInfoClasses.GetAccount(user); // Find the menu session associated with the current user and store it in a variable. var menuSession = Global.MenuIdList.SingleOrDefault(x => x.User.Id == user.Id); 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)); // Attempt deleting the message if it hasn't been deleted by the user yet. try { // Delete the current message from the channel. await message.DeleteAsync(); } catch (Exception ex) { Console.WriteLine(ex); } // If the bot lacks permission to send messages, catch the exception and return. try { // Reassign the menu session's message to a new message generated from the created embed. menuSession.MenuMessage = (RestUserMessage)await message.Channel.SendMessageAsync("", false, embed.Build()); } catch (Exception ex) { Console.WriteLine(ex); return; } // Set the "message" variable to the menu session's message. message = menuSession.MenuMessage; // Edit the menu session according to the current message. menuSession.CurrentMenu = "Status_Decor_Exit"; 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 }; // Create a new menu in the current channel. await Profile_Settings_Menu.Profile_Settings_Main(menuSession.User, menuSession.MenuMessage); }
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 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); }
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 Task Time_Weather_Main(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 = "Time Zone & Weather", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "↩️ Return to General Settings Menu" }; embed.WithFooter(footer); // Determine the color and thumbnail for the embeded message embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Config_Thumbnail(account)); // Get the date, time, and weather information for the user's location and store it in a variable. var dataObject = Get_Weather_API_Info(account.City); embed.WithDescription("" + "Set a city to automatically configure the date, times of day, and weather readings for your user profile.\n" + "\n" + $"⚙️ **Current Setting:**\n" + $"\n" + $"Location: **`{dataObject.location.name.ToString()}`**\n" + $"Region: **`{dataObject.location.region.ToString()}`**\n" + $"Country: **`{dataObject.location.country.ToString()}`**\n" + $"\n" + $"Type in a city you’d like to use with Social Linker, or react with ↩️ to cancel."); // 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 = "Time_Weather_Main"; 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("↩️")); // Add the reactions to the message. _ = ReactionHandling.AddReactionsToMenu(message, reaction_list); }
public static async Task Time_Weather_Error(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 = "Location Not Found", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "↩️ Retry" }; embed.WithFooter(footer); // Determine the color and thumbnail for the embeded message. embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Config_Thumbnail(account)); embed.WithDescription("" + "It looks like an invalid city was typed in. React with ↩️ to try again.\n"); embed.AddField("Tips", "" + "Try using the names of major cities or other well-known locations."); // 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 = "Time_Weather_Error"; 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("↩️")); // Add the reactions to the message. _ = ReactionHandling.AddReactionsToMenu(message, reaction_list); }
public static async Task Status_Decor_Start(SocketGuildUser user, RestUserMessage message) { //Get the account information of the command's target 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 = "Now Loading...", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); // Determine the color and thumbnail for the embeded message. embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); // Create an empty string list. List <string> owned_decor = new List <string> { }; // Check if the user owns any décor. if (account.Decor_Owned != "") { // If so, convert their Decor_Owned value into a string list and assign it to the owned_decor string list. owned_decor = DecorInfoMethods.StringToStringArray(account.Decor_Owned); } // Create another empty string list. List <string> user_content_filter = new List <string> { }; // Check if the user has any titles listed in their content filter. if (account.Content_Filter != "") { // If so, convert their Content_Filter value into a string list and assign it to the user_content_filter string list. user_content_filter = DecorInfoMethods.StringToStringArray(account.Content_Filter); } // Create a new list by removing any décor that contains content specified in the user's content filter and assign it to the owned_decor variable. owned_decor = DecorInfoMethods.RemoveBlockedContentFromList(owned_decor, user_content_filter); // Search for an item list that corresponds to the user's ID. var itemSession = Global.ItemIdList.SingleOrDefault(x => x.User.Id == user.Id); // If an item session already exists, remove it from the global list. if (itemSession != null) { Global.ItemIdList.Remove(itemSession); } // Create a new item identifier entry for this current user to keep track of the position of décor on the menu. itemSession = new ItemListIterator() { User = user, ItemList = owned_decor, ItemIndexBase = 0, MaxItemsDisplayed = 6, CurrentPage = 1 }; // Add the item entry to the global list. Global.ItemIdList.Add(itemSession); // Attempt editing the message if it hasn't been deleted by the user yet. If it has, catch the exception, send an error message, 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) { await ErrorHandling.MissingMessageError((SocketTextChannel)message.Channel); Console.WriteLine(ex); return; } // Edit the menu session according to the current message. menuSession.CurrentMenu = "Status_Decor_Start"; 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 }; // Create a new menu in the current channel. await Status_Decor_Main(menuSession.User, menuSession.MenuMessage); }
public static async Task SM_Tutorial_Anime_Frames_Page_2(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 = "Using Animation Frames", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "◀️ Previous Page | ▶️ Next Page\n" + "Page 2 / 3" }; embed.WithFooter(footer); // 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("" + "If you string together numbers for the base sprite, an eye frame, and a mouth frame with hyphens, you can create even more varied expressions with your scenes."); // 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 = "SM_Tutorial_Anime_Frames_Page_2"; 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 async Task Star_Level_Main(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 = "Star Level", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "↩️ Back | ✅ Confirm" }; embed.WithFooter(footer); // Determine the color and thumbnail for the embeded message embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Config_Thumbnail(account)); string description_text = ""; if (account.Level_Resets == 0) { description_text = "" + "Star Level is a special rank that lets you keep earning P-Medals past Level 99!\n" + "Your profile will be reset to Level 1, but a signature mark will appear on your status screen and all your social stats stay intact for P-Medal bonuses.\n" + "\n" + "Would you like to reach to Star Level Rank 1?"; } else if (account.Level_Resets == 1) { description_text = "" + "You've maxed out your level twice! This is the final stretch...\n" + "You can reach Star Level Rank 2 by resetting your level again while gaining another star mark and keeping your social stats intact.\n" + "\n" + "Would you like to reach Star Level Rank 2?"; } else if (account.Level_Resets == 2) { description_text = "" + "You've made it! This is the end goal of Social Linker.\n" + "This time, there are no more level resets. All levels and social stats remain completely intact going forward.\n" + "\n" + "Would you like to reach Star Level Rank 3?"; } embed.WithDescription(description_text); // 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 = "Star_Level_Main"; 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 async Task Status_Tutorial_Page_2(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 = "Social Stats", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "◀️ Previous Page | ▶️ Next Page\n" + "Page 2 / 5" }; embed.WithFooter(footer); // 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("" + "Social stats are determined by how interactive you are with Social Linker. There’s a daily limit for points earned with each one, so come back often to see them grow.\n" + "\n" + "**• Proficiency:** Increases through use of Social Linker commands.\n" + "**• Diligence:** Increases through daily Discord activity.\n" + "**• Expression:** Increases through usage of social commands by you or by others."); // 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 = "Status_Tutorial_Page_2"; 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 async Task SM_Tutorial_Basics_Page_3(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 = "Using Sprite Sheets", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "◀️ Previous Page | ▶️ Next Page\n" + "Page 3 / 6" }; embed.WithFooter(footer); // 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("" + $"Once you find a character you want, use the format **`{BotConfig.bot.cmdPrefix}maker [character]`** to display their sprite sheet.\n" + "\n" + "If the character appears in more than one title, this will only bring up their sprite sheet from the game they originated from. " + "To specify their sprite sheet from another title, type one of the template keywords after their name."); // 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 = "SM_Tutorial_Basics_Page_3"; 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 async Task SM_Tutorial_Basics_Page_1(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 = "Persona Scene Maker", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "↩️ Return to Previous Menu | ▶️ Next Page\n" + "Page 1 / 6" }; embed.WithFooter(footer); // 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("" + "The scene maker lets you generate images resembling screenshots from the Persona series.\n" + "\n" + $"Each image is called a “scene” and can be generated with a variety of commands with the prefix **`{BotConfig.bot.cmdPrefix}maker`**."); // 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 = "SM_Tutorial_Basics_Page_1"; 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 async Task SM_Tutorial_Dual_Chara_Page_1(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 = "Dual Character Scenes", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "↩️ Return to Tips & Tricks Menu | ▶️ Next Page\n" + "Page 1 / 2" }; embed.WithFooter(footer); // 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("" + $"Type **`{BotConfig.bot.cmdPrefix}maker dual`** to start creating a scene with two characters. This is only possible with a select few templates, so choose the one you think fits best and follow the instructions provided."); // 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 = "SM_Tutorial_Dual_Chara_Page_1"; 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 async Task Settings_Main_Menu(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 = "User Settings", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "❌ Close Menu" }; embed.WithFooter(footer); // Determine the color and thumbnail for the embeded message embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Config_Thumbnail(account)); embed.AddField(":one: General Settings", "Set your time zone, weather, notification, and content settings."); embed.AddField(":two: Profile Settings", "Change your profile theme and status screen décor."); embed.AddField(":three: Scene Maker Settings", "Change general scene maker settings."); // 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 = "Settings_Main_Menu"; 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("\u0031\ufe0f\u20e3")); reaction_list.Add(new Emoji("\u0032\ufe0f\u20e3")); reaction_list.Add(new Emoji("\u0033\ufe0f\u20e3")); reaction_list.Add(new Emoji("❌")); // Add the reactions to the message. _ = ReactionHandling.AddReactionsToMenu(message, reaction_list); }
public static async Task Decor_Sort_Confirm(SocketGuildUser user, RestUserMessage message) { // Get the account information of the command's target var account = UserInfoClasses.GetAccount(user); // Find both the menu session and item session associated with the current user and store them in variables. var menuSession = Global.MenuIdList.SingleOrDefault(x => x.User.Id == user.Id); var itemSession = Global.ItemIdList.SingleOrDefault(x => x.User.Id == user.Id); // Create a new embed that will be displayed in the message. var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Settings Saved", IconUrl = user.GetAvatarUrl() }; var footer = new EmbedFooterBuilder { Text = "💠 Décor Settings | ❌ Close Menu" }; embed.WithAuthor(author); embed.WithFooter(footer); embed.WithDescription($"Décor will now be sorted **`{DecorInfoMethods.SortSettingToString(account.Shop_Sort)}`**."); // Determine the color and thumbnail for the embeded message. embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Config_Thumbnail(account)); // Attempt editing the message if it hasn't been deleted by the user yet. If it has, catch the exception, send an error message, 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) { await ErrorHandling.MissingMessageError((SocketTextChannel)message.Channel); Console.WriteLine(ex); return; } // Edit the menu session according to the current message. menuSession.CurrentMenu = "Decor_Sort_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 timer runs out, activate a function. menuSession.MenuTimer.Elapsed += (sender, e) => MenuTimer_Elapsed(sender, e, menuSession, itemSession); // 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 async Task Decor_Sort(SocketGuildUser user, RestUserMessage message) { // Get the account information of the command's target var account = UserInfoClasses.GetAccount(user); // Find both the menu session and item session associated with the current user and store them in variables. var menuSession = Global.MenuIdList.SingleOrDefault(x => x.User.Id == user.Id); var itemSession = Global.ItemIdList.SingleOrDefault(x => x.User.Id == user.Id); // Create a new embed that will be displayed in the message. var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Sort Décor", IconUrl = user.GetAvatarUrl() }; var footer = new EmbedFooterBuilder { Text = "↩️ Back" }; embed.WithAuthor(author); embed.WithFooter(footer); embed.AddField("Choose a method to sort décor entries by.", $"" + $"⚙️ **Current Setting:** **`{DecorInfoMethods.SortSettingToString(account.Shop_Sort)}`**\n" + $"\n" + $":one: By Title (A - Z)\n" + $":two: By Title (Z - A)\n" + $":three: By Cost (Low - High)\n" + $":four: By Cost (High - Low)\n" + $":five: By Release Order (Old - New)\n" + $":six: By Release Order (New - Old)"); // Determine the color and thumbnail for the embeded message. embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Config_Thumbnail(account)); // Attempt deleting the message if it hasn't been deleted by the user yet. try { // Delete the current message from the channel. await message.DeleteAsync(); } catch (Exception ex) { Console.WriteLine(ex); } // If the bot lacks permission to send messages, catch the exception and return. try { // Reassign the menu session's message to a new message generated from the created embed. menuSession.MenuMessage = (RestUserMessage)await message.Channel.SendMessageAsync("", false, embed.Build()); } catch (Exception ex) { Console.WriteLine(ex); return; } // Set the "message" variable to the menu session's message. message = menuSession.MenuMessage; // Edit the menu session according to the current message. menuSession.CurrentMenu = "Decor_Sort"; 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 timer runs out, activate a function. menuSession.MenuTimer.Elapsed += (sender, e) => MenuTimer_Elapsed(sender, e, menuSession, itemSession); // 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")); reaction_list.Add(new Emoji("\u0033\ufe0f\u20e3")); reaction_list.Add(new Emoji("\u0034\ufe0f\u20e3")); reaction_list.Add(new Emoji("\u0035\ufe0f\u20e3")); reaction_list.Add(new Emoji("\u0036\ufe0f\u20e3")); // Add the reactions to the message. _ = ReactionHandling.AddReactionsToMenu(message, reaction_list); }
public static async Task Set_Decor_Confirm(SocketGuildUser user, RestUserMessage message) { // Get the account information of the command's target var account = UserInfoClasses.GetAccount(user); // Find both the menu session and item session associated with the current user and store them in variables. var menuSession = Global.MenuIdList.SingleOrDefault(x => x.User.Id == user.Id); var itemSession = Global.ItemIdList.SingleOrDefault(x => x.User.Id == user.Id); // Create a string variable that will hold the title of the user's currently set décor. string set_decor_title = DecorInfoMethods.GetDecorTitle(user); // Create a new embed that will be displayed in the message. var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Settings Saved", 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_Config_Thumbnail(account)); embed.WithDescription($"Your décor has been set to **`{set_decor_title}`**."); var footer = new EmbedFooterBuilder { Text = "💠 Décor Settings | ❌ Close Menu" }; // Add the footer to the embed. embed.WithFooter(footer); // Attempt deleting the message if it hasn't been deleted by the user yet. try { // Delete the current message from the channel. await message.DeleteAsync(); } catch (Exception ex) { Console.WriteLine(ex); } // If the bot lacks permission to send messages, catch the exception and return. try { // Reassign the menu session's message to a new message generated from the created embed. menuSession.MenuMessage = (RestUserMessage)await message.Channel.SendMessageAsync("", false, embed.Build()); } catch (Exception ex) { Console.WriteLine(ex); return; } // Set the "message" variable to the menu session's message. message = menuSession.MenuMessage; // Edit the menu session according to the current message. menuSession.CurrentMenu = "Set_Decor_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, itemSession); // 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 async Task Status_Tutorial_Page_1(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 = "Status Screens", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "↩️ Return to Help Menu | ▶️ Next Page\n" + "Page 1 / 5" }; embed.WithFooter(footer); // 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("Status screens keep track of your various Discord activities. Depending on which theme you set your profile to, they can take on different appearances."); // 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 = "Status_Tutorial_Page_1"; 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 async Task Status_Tutorial_Page_5(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 and Commands", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "◀️ Previous Page | 💠 Return to Help Menu\n" + "Page 5 / 5" }; embed.WithFooter(footer); // 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 set your profile theme at any time from the **`{BotConfig.bot.cmdPrefix}settings`** menu by choosing [Profile Theme Settings].\n" + "Use the following commands to access these main features:\n"); embed.AddField($"Command List", "> **`>status`**\n" + "Check your status screen.\n" + "Type `detail` after it to view a detailed breakdown of your profile, or tag a user to view theirs.\n" + "\n" + "> **`>shop`**\n" + "Access the status screen Décor Shop."); // 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 = "Status_Tutorial_Page_5"; 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 async Task SM_Tutorial_Basics_Page_4(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 = "Creating a Scene", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "◀️ Previous Page | ▶️ Next Page\n" + "Page 4 / 6" }; embed.WithFooter(footer); // 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("" + "String together a character keyword, one of their sprite numbers, and the dialogue you want them to say within quotation marks to create a scene.\n" + "\n" + $"The template will form according to your settings, which you can adjust by typing **`{BotConfig.bot.cmdPrefix}settings`** and choosing [Scene Maker Settings]."); // 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 = "SM_Tutorial_Basics_Page_4"; 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 async Task Credits_Main(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 = "Credits", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "↩️ Return to Help Menu" }; embed.WithFooter(footer); // 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.AddField("Programming & Design", "" + "[Microjack5](https://twitter.com/Microjack5)\n"); embed.AddField("Quality Assurance Advisors", "" + "[Angel ✨](https://twitter.com/_Amaurot)\n" + "[Arkane](https://twitter.com/ArkaneOnline)\n" + "[Azure](https://twitter.com/Azure_Blazes)\n" + "[Camz](https://twitter.com/Camzcer)\n" + "[Corrin](https://twitter.com/LocalSynth)\n" + "[Kara](https://discordapp.com/users/707398527575130162/)\n" + "[Mel](https://twitter.com/skyseekingdream)\n" + "[Naanos](https://www.youtube.com/channel/UCiUR9b-ptxqSbKw0vIaDklg)\n" + "[無限 | Nate](https://twitter.com/CrestofDog)\n" + "[RomIsALemon](https://twitter.com/phighters_rom)\n" + "[Shadow Kawa](https://discordapp.com/users/210080634498973696/)\n" + "[SlimePupAribaba](https://twitter.com/SlimePupAribaba)\n" + "[Squishy](https://twitter.com/Squishy_Mona)\n" + "[Thena](https://twitter.com/ThenaIsLost)\n" + "[TooBlue!](https://twitter.com/EMOMESSlAH)\n" + "[WaffleBandito](https://twitter.com/WaffIeBandito)\n"); embed.AddField("Asset Advisors", "" + "[80constant](https://twitter.com/80constant_)\n" + "[Arkane](https://twitter.com/ArkaneOnline)\n" + "[Canasniimehugh](https://www.vg-resource.com/user-17021.html)\n" + "[EsperKnight](https://twitter.com/esperknight)\n" + "[Geo](https://github.com/Geordan9)\n"); embed.AddField("Status Décor Designers", "" + "[danny !](https://twitter.com/SPACECHANEL5)\n" + "[Microjack5](https://twitter.com/Microjack5)\n" + "[無限 | Nate](https://discordapp.com/users/140846765275348993/)\n" + "[TooBlue!](https://twitter.com/EMOMESSlAH)\n"); embed.AddField("Gameplay Footage", "" + "[BuffMaister](https://www.youtube.com/channel/UCks_VIIleZT2iDWNipPglUg)\n" + "[Faz](https://www.youtube.com/channel/UCEevYX4rCcfF0ZrxmnnONXA)\n" + "[Ignis](https://www.youtube.com/channel/UCHViTnm0pNN3BwvOwGqlPgQ)\n" + "[JohneAwesome](https://www.youtube.com/user/JohneAwesome)\n" + "[Literally Satan GAMING](https://www.youtube.com/channel/UCfdQp9SVfAMQEtD3jQAoXLg)\n" + "[Noire Blue](https://www.youtube.com/channel/UCUZpzh41JoA4bbgfQL1hx7A)\n" + "[PuppiStation](https://www.youtube.com/channel/UCv3PDRDC9cRw9Yzgb_NzgYg)\n" + "[RandomPl0x](https://www.youtube.com/c/RandomChannelPlox)\n" + "[Shirrako](https://www.youtube.com/channel/UC7eAfUjR9gdIjoaoQaS0W-A)\n"); embed.AddField("Services", "" + "[Microsoft Azure](https://azure.microsoft.com/)\n" + "[Weather API](https://www.weatherapi.com/)\n"); embed.AddField("Special Thanks", "" + "[Joseph Navarro](https://github.com/josephnavarro)\n" + "[Meloman19](https://github.com/Meloman19)\n" + "[Petr Sedláček](https://github.com/petrspelos)\n" + "[ShrineFox](https://shrinefox.com/)\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 = "Credits_Main"; 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("↩️")); // Add the reactions to the message. _ = ReactionHandling.AddReactionsToMenu(message, reaction_list); }
public static async Task SM_Tutorial_Basics_Page_5(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 = "Cross-compatibility", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "◀️ Previous Page | ▶️ Next Page\n" + "Page 5 / 6" }; embed.WithFooter(footer); // 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("" + "To use a character sprite in a template they don’t belong to, use a template keyword right before the character’s name when creating a scene.\n" + "\n" + "Some character sprites might be too small to appear normally in other templates. They’ll be formatted in other ways that are natural to the game’s aesthetics."); // 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 = "SM_Tutorial_Basics_Page_5"; 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 async Task Star_Level_Check(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 = "Are You Sure?", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); // Create an empty string variable. This will store part of the footer's text. string confirm_text = ""; // Add a specific star icon to the confirm_text variable depending on how many times the user's level has been reset. if (account.Level == 99 && account.Level_Resets == 0) { confirm_text = "⭐ Confirm"; } else if (account.Level == 99 && account.Level_Resets == 1) { confirm_text = "🌟 Confirm"; } else if (account.Level == 99 && account.Level_Resets == 2) { confirm_text = "✨ Confirm"; } // Create and add the footer to the embeded message. var footer = new EmbedFooterBuilder { Text = $"💠 Return to Profile Settings Menu | {confirm_text}" }; embed.WithFooter(footer); // Determine the color and thumbnail for the embeded message embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Config_Thumbnail(account)); if (account.Level_Resets == 0) { embed.WithDescription($"Are you sure you want to gain Star Level rank and reset your level? This cannot be undone."); } else if (account.Level_Resets == 1) { embed.WithDescription($"Are you sure you want to gain another Star Level rank and reset your level? This cannot be undone."); } else if (account.Level_Resets == 2) { embed.WithDescription($"Are you sure? No turning back!"); } // 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 = "Star_Level_Check"; 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("💠")); // Add a star reaction to the menu depending on how many times the user's level has been reset. if (account.Level == 99 && account.Level_Resets == 0) { reaction_list.Add(new Emoji("⭐")); } else if (account.Level == 99 && account.Level_Resets == 1) { reaction_list.Add(new Emoji("🌟")); } else if (account.Level == 99 && account.Level_Resets == 2) { reaction_list.Add(new Emoji("✨")); } // Add the reactions to the message. _ = ReactionHandling.AddReactionsToMenu(message, reaction_list); }
public static async Task SM_Tutorial_Basics_Page_2(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 = "Character Lists and Templates", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "◀️ Previous Page | ▶️ Next Page\n" + "Page 2 / 6" }; embed.WithFooter(footer); // 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("" + "There are multiple templates to choose from based on each title:\n" + "\n" + "<:P1:751133115531133112> `P1` - **Persona**\n" + "<:P2IS:788950080396328990> `P2IS` - **Persona 2: Innocent Sin**\n" + "<:P2EP:788950163363463172> `P2EP` - **Persona 2: Eternal Punishment**\n" + "<:P3:751133114918633483> `P3` - **Persona 3**\n" + "<:P4:751133120530612274> `P4` - **Persona 4**\n" + "<:P4AU:751133122342420572> `P4AU` - **Persona 4 Arena Ultimax**\n" + "<:P4D:751133120346062859> `P4D` - **Persona 4: Dancing All Night**\n" + "<:P5:751133123861020742> `P5` - **Persona 5**\n" + "<:BBTAG:751133123013771617> `BBTAG` - **BlazBlue: Cross Tag Battle**\n" + "\n" + $"Use the format **`{BotConfig.bot.cmdPrefix}maker [template]`** to view the names of characters with sprites for that title."); // 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 = "SM_Tutorial_Basics_Page_2"; 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 async Task Star_Level_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(); string header_text = ""; string description_text = ""; if (account.Level_Resets == 1) { header_text = "Welcome to Star Level!"; description_text = "" + "Your Star Level is now at Rank 1! A rank above the rest!\n" + "\n" + "There are three possible ranks you can reach in Star Level. Maybe a special surprise awaits at the final one...?\n" + "\n" + "Only one way to find out! Go out and show off your new rank with pride!"; } else if (account.Level_Resets == 2) { header_text = "Star Level Rank Up!!"; description_text = "" + "Your Star Level is now at Rank 2! You've come an amazingly long way. Congratulations!"; } else if (account.Level_Resets == 3) { header_text = "STAR LEVEL RANK MAX!!"; description_text = "" + "You've completely maxed out your Star Level! There are no other greater accomplishments past this point.\n" + "\n" + "As a special gift, all décor in the Décor Shop are now completely free for you from this point onwards. Thank you for being active and using Social Linker so much over the past few years!"; } var author = new EmbedAuthorBuilder { Name = header_text, IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "💠 Return to Profile Settings Menu | ❌ Close Menu" }; embed.WithFooter(footer); // Determine the color and thumbnail for the embeded message embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Config_Thumbnail(account)); embed.WithDescription(description_text); // 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 = "Star_Level_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 async Task Rank_Up_Notifications_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 = "💠 Return to General Settings Menu | ❌ Close Menu" }; embed.WithFooter(footer); // Determine the color and thumbnail for the embeded message. embed.WithColor(EmbedSettings.Get_Profile_Embed_Color(account)); embed.WithThumbnailUrl(EmbedSettings.Get_Profile_Config_Thumbnail(account)); embed.WithDescription($"Rank up notifications have been set to **`{account.Level_Up_Notifications}`**."); // 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 = "Rank_Up_Notifications_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 async Task SM_Tutorial_Basics_Page_6(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 = "Backgrounds & Deleting Scenes", IconUrl = user.GetAvatarUrl() }; embed.WithAuthor(author); var footer = new EmbedFooterBuilder { Text = "" + "◀️ Previous Page | 💠 Return to Tutorial Menu\n" + "Page 6 / 6" }; embed.WithFooter(footer); // 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("" + "To use a background, upload an image alongside your command when creating a scene.\n" + "\n" + "You can also delete scenes you’ve already made by reacting to them with the :x: emote."); // 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 = "SM_Tutorial_Basics_Page_6"; 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 async Task Status_Decor_Main(SocketGuildUser user, RestUserMessage message) { // Get the account information of the command's user. var account = UserInfoClasses.GetAccount(user); // Find both the menu session and item session associated with the current user and store them in variables. var menuSession = Global.MenuIdList.SingleOrDefault(x => x.User.Id == user.Id); var itemSession = Global.ItemIdList.SingleOrDefault(x => x.User.Id == user.Id); var embed = new EmbedBuilder(); var author = new EmbedAuthorBuilder { Name = "Status Screen Décor", 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_Config_Thumbnail(account)); // Create a string variable to store the text that will be displayed on the message's body. string displayed_decor_list = ""; // Create an int variable from the number of items in the list minus the starting index to count from. // Since the ItemIndexBase should always initially start at zero, nothing will be subtracted at first but will adjust as the index moves when the page changes. int remaining_list_length = itemSession.ItemList.Count - itemSession.ItemIndexBase; // Create another int variable that will indicate a subset of the item list that the user is currently viewing. int sublist_length = 0; // If the remaining number of items in the list is greater than or equal to the max amount of items that should be displayed, make the sublist_length int also equal to max_items_displayed. if (remaining_list_length >= itemSession.MaxItemsDisplayed) { sublist_length = itemSession.MaxItemsDisplayed; } // Else, if the number of remaining items is less than max_items_displayed, make sublist_length equal to the remaining number of items. else { sublist_length = remaining_list_length; } // Create an int to properly display the needed emotes when iterating through the item list. int displayed_list_counter = 0; // Iterate through the item list starting from the ItemBaseIndex and up until sublist_length. for (int i = itemSession.ItemIndexBase; i < (itemSession.ItemIndexBase + sublist_length); i++) { // Increase the displayed_list_counter by one. displayed_list_counter += 1; // Get the information of the current décor iteration. var decor_info = DecorInfoMethods.GetDecorInfo(itemSession.ItemList[i]); // Add the entry to the displayed_shop_list string. displayed_decor_list += $":{DecorInfoMethods.NumberToWords(displayed_list_counter)}: {decor_info.Title}\n"; } // Create a string variable to store text for the footer. This will change depending on the state of the menu. string footer_text = ""; // Depending on whether or not the user owns or can set any décor, perform different actions. if (displayed_decor_list.Length > 0) { // Add a "Back" button to be displayed on the footer. footer_text += "↩️ Profile Settings | "; // Check if the starting item index is greater than or equal to max_items_displayed. if (itemSession.ItemIndexBase >= itemSession.MaxItemsDisplayed) { // If so, there will be a "Previous Page" button displayed on the footer. footer_text += "◀️ Previous Page | "; } // Check if the number of items in the list minus the starting item index is more than max_items_displayed. if (remaining_list_length > itemSession.MaxItemsDisplayed) { // If so, there will be a "Next Page" button on the footer. footer_text += "▶️ Next Page | "; } // Calculate the amount of pages there will be in total and store it in a variable. int pageCount = (itemSession.ItemList.Count + itemSession.MaxItemsDisplayed - 1) / itemSession.MaxItemsDisplayed; // Add two icons to the end of footer_text regardless of the state, plus a page counter on a new line. footer_text += $"⚙️ Sort\nPage {itemSession.CurrentPage} / {pageCount}"; // Create the footer object for the embed. var footer = new EmbedFooterBuilder { Text = footer_text }; // Add the footer to the embed. embed.WithFooter(footer); // Create an empty string variable. This will hold part of the embeded message's description string description_text = ""; // If the user has a décor and a profile theme currently set, create a description text explaining how to remove the currently set décor. if (account.Decor_Setting != "" && account.Profile_Theme != "") { description_text = "" + "**Select a décor to view.**\n" + "**To remove your current décor and set the default one for your profile theme, select :white_square_button:.**"; } // If not, create a default description text instructing to select a décor. else { description_text = "**Select a décor to view.**"; } // Create a string variable that will hold the title of the user's currently set décor. string set_decor_title = DecorInfoMethods.GetDecorTitle(user); embed.WithDescription("" + $"{description_text}\n" + "\n" + $"⚙️ **Current setting:** **`{set_decor_title}`**\n" + "\n" + $"{displayed_decor_list}"); // Attach a locally generated image to the embed. embed.WithImageUrl($"attachment://preview.png"); // Create a new stream. We'll use this to create the locally generated image. MemoryStream memoryStream = new MemoryStream(); // Generate a bitmap comprised of thumbnail previews of the décor being listed on the current page. Bitmap decor_preview = DecorInfoMethods.DecorPreviews(itemSession, sublist_length); // Save the décor preview bitmap to the stream as a PNG. decor_preview.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Png); // Ensure the stream is set to the beginning of itself. memoryStream.Seek(0, SeekOrigin.Begin); // Attempt deleting the message if it hasn't been deleted by the user yet. try { // Delete the current message from the channel. await message.DeleteAsync(); } catch (Exception ex) { Console.WriteLine(ex); } // If the bot lacks permission to attach files, catch the exception, send an error message, and return. try { // Reassign the menu session's message to a new message generated from the created embed and preview image. menuSession.MenuMessage = (RestUserMessage)await message.Channel.SendFileAsync(memoryStream, "preview.png", "", false, embed.Build()); } catch (Exception ex) { await ErrorHandling.AttachFilesError((SocketTextChannel)message.Channel); Console.WriteLine(ex); return; } // Set the "message" variable to the menu session's message. message = menuSession.MenuMessage; } else { // Add a "Back" button to be displayed on the footer. footer_text += "↩️ Profile Settings"; // Create the footer object for the embed. var footer = new EmbedFooterBuilder { Text = footer_text }; // Add the footer to the embed. embed.WithFooter(footer); embed.WithDescription("You don't have any other décor to set. Visit the Décor Shop with the **`>shop`** command to browse and buy décor for your collection."); // Attempt editing the message if it hasn't been deleted by the user yet. If it has, catch the exception, send an error message, 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) { await ErrorHandling.MissingMessageError((SocketTextChannel)message.Channel); Console.WriteLine(ex); return; } } // Edit the menu session according to the current message. menuSession.CurrentMenu = "Status_Decor_Main"; 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 timer runs out, activate a function. menuSession.MenuTimer.Elapsed += (sender, e) => MenuTimer_Elapsed(sender, e, menuSession, itemSession); // 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("↩️")); // Check if the starting item index is greater than or equal to max_items_displayed. if (itemSession.ItemIndexBase >= itemSession.MaxItemsDisplayed) { // If so, there will be a "Previous Page" button added as a reaction. reaction_list.Add(new Emoji("◀️")); } // Check if the number of items in the list minus the starting item index is more than max_items_displayed. if (remaining_list_length > itemSession.MaxItemsDisplayed) { // If so, there will be a "Next Page" button added as a reaction. reaction_list.Add(new Emoji("▶️")); } // Reset the displayed_list_counter to zero. displayed_list_counter = 0; for (int i = 0; i < sublist_length; i++) { // Increase the displayed_list_counter by one. displayed_list_counter += 1; // For each loop iteration, add a keycap emote representing an item entry being displayed to the user. reaction_list.Add(new Emoji($"{DecorInfoMethods.NumberToKeycapEmoji(displayed_list_counter)}")); } // If the user owns any décor, add a gear reaction in order to sort entries. if (displayed_decor_list.Length > 0) { reaction_list.Add(new Emoji("⚙️")); } // If the user has a décor and a profile theme currently set, add a box reaction. This gives the option to remove the set décor and return to the default one. if (account.Decor_Setting != "" && account.Profile_Theme != "") { reaction_list.Add(new Emoji("🔳")); } // Add the reactions to the message. _ = ReactionHandling.AddReactionsToMenu(message, reaction_list); }