Added in Description tags to a bunch of things.

This commit is contained in:
Christopher Darnell committed 2021-04-28 14:16:38 -07:00
1 parent c35e0f71f7
commit 08091e7456
13 files changed
+58 -25

No files matched your search

+1
View File
@@ -72,6 +72,7 @@ namespace StarsiegeBot
} }
} }
[GroupCommand] [GroupCommand]
[Description("Work in progress. Does nothing yet.")]
public async Task BaseItem(CommandContext ctx) public async Task BaseItem(CommandContext ctx)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
@@ -49,7 +49,7 @@ namespace StarsiegeBot
} }
[Command("add")] [Command("add")]
public async Task AddGroup(CommandContext ctx, [RemainingText] string groupName) public async Task AddGroup(CommandContext ctx, [RemainingText, Description("Group to create.")] string groupName)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
string gId = ctx.Guild.Id.ToString(); string gId = ctx.Guild.Id.ToString();
@@ -67,7 +67,7 @@ namespace StarsiegeBot
// TODO: Delete all roles or assign new group? // TODO: Delete all roles or assign new group?
[Command("delete")] [Command("delete")]
public async Task RemoveGroup(CommandContext ctx, [RemainingText] string groupName) public async Task RemoveGroup(CommandContext ctx, [RemainingText, Description("Group to delete")] string groupName)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
string gId = ctx.Guild.Id.ToString(); string gId = ctx.Guild.Id.ToString();
@@ -83,6 +83,7 @@ namespace StarsiegeBot
} }
[Command("edit")] [Command("edit")]
[Description("This is under construction. Does nothing yet.")]
public async Task EditGroup(CommandContext ctx, [RemainingText] string groupInfo) public async Task EditGroup(CommandContext ctx, [RemainingText] string groupInfo)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
@@ -24,6 +24,7 @@ using System.Threading;
namespace StarsiegeBot namespace StarsiegeBot
{ {
[Group("GroupRole")] [Group("GroupRole")]
[Description("Work in progress. Does nothing yet.")]
[RequireGuild, RequirePermissions(Permissions.ManageRoles)] [RequireGuild, RequirePermissions(Permissions.ManageRoles)]
class GroupRoleManagement : BotSettings class GroupRoleManagement : BotSettings
{ {
@@ -39,7 +40,8 @@ namespace StarsiegeBot
} }
[Command("add")] [Command("add")]
public async Task AddSelfRole(CommandContext ctx, DiscordRole role, int price = 0, string group = null) [Description("Work in progress. Does nothing yet.")]
public async Task AddSelfRole(CommandContext ctx, [Description("The role to add.")]DiscordRole role, [Description("The price of the role for buyable roles. 0 for no cost. Free free to leave blank if not using Buyable roles.")]int price = 0, [Description("What group to put the role in. If not using groups, you can leave blank.")]string group = null)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
if (price == -1) if (price == -1)
@@ -49,12 +51,14 @@ namespace StarsiegeBot
} }
[Command("delete")] [Command("delete")]
public async Task DeleteSelfRole(CommandContext ctx, DiscordRole role, string group = null) [Description("Work in progress. Does nothing yet.")]
public async Task DeleteSelfRole(CommandContext ctx, [Description("The role to delete.")] DiscordRole role, [Description("The group to remove the role from. If left blank, will remove from all groups.")]string group = null)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
} }
[Command("Edit")] [Command("Edit")]
[Description("Work in progress. Does nothing yet.")]
public async Task EditRole(CommandContext ctx, DiscordRole role, int newPrice = 0, [RemainingText] string newGroup = null) public async Task EditRole(CommandContext ctx, DiscordRole role, int newPrice = 0, [RemainingText] string newGroup = null)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
@@ -25,6 +25,7 @@ namespace StarsiegeBot
{ {
[Group("Level")] [Group("Level")]
[RequireGuild, RequirePermissions(Permissions.ManageRoles)] [RequireGuild, RequirePermissions(Permissions.ManageRoles)]
[Description("Work in progress. Does nothing yet.")]
class LevelManagement : BotSettings class LevelManagement : BotSettings
{ {
public LevelManagement() public LevelManagement()
@@ -33,12 +34,14 @@ namespace StarsiegeBot
} }
[GroupCommand] [GroupCommand]
[Description("Work in progress. Does nothing yet.")]
public async Task ListLevels(CommandContext ctx) public async Task ListLevels(CommandContext ctx)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
} }
[Command("AddLevel"), Aliases("al")] [Command("AddLevel"), Aliases("al")]
[Description("Work in progress. Does nothing yet.")]
public async Task AddLevel(CommandContext ctx, int newLevelGroup) public async Task AddLevel(CommandContext ctx, int newLevelGroup)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
@@ -46,12 +49,14 @@ namespace StarsiegeBot
[Command("DeleteLevel"), Aliases("dl")] [Command("DeleteLevel"), Aliases("dl")]
[Description("Work in progress. Does nothing yet.")]
public async Task DeleteLevel(CommandContext ctx, int oldLevelGroup) public async Task DeleteLevel(CommandContext ctx, int oldLevelGroup)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
} }
[Command("edit")] [Command("edit")]
[Description("Work in progress. Does nothing yet.")]
public async Task EditLevel (CommandContext ctx, int oldLeve, int newLevel) public async Task EditLevel (CommandContext ctx, int oldLeve, int newLevel)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
@@ -33,28 +33,31 @@ namespace StarsiegeBot
} }
[Command("edit")] [Command("edit")]
[Description("Work in progress. Does nothing yet.")]
public async Task EditRole(CommandContext ctx, int oldLevel, int newLevel, DiscordRole role) public async Task EditRole(CommandContext ctx, int oldLevel, int newLevel, DiscordRole role)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
} }
[Command("edit")] [Command("edit")]
[Description("Work in progress. Does nothing yet.")]
public async Task EditRole(CommandContext ctx, int newLevel, [RemainingText] string role) public async Task EditRole(CommandContext ctx, int newLevel, [RemainingText] string role)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
} }
[Command("remove")] [Command("remove")]
[Description("Work in progress. Does nothing yet.")]
public async Task RemoveRole(CommandContext ctx, DiscordRole role) public async Task RemoveRole(CommandContext ctx, DiscordRole role)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
} }
[Command("remove")] [Command("remove")]
[Description("Work in progress. Does nothing yet.")]
public async Task RemoveRole(CommandContext ctx, [RemainingText] string roleName) public async Task RemoveRole(CommandContext ctx, [RemainingText] string roleName)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
} }
} }
} }
@@ -33,24 +33,28 @@ namespace StarsiegeBot
} }
[Command("join")] [Command("join")]
[Description("Work in progress. Does nothing yet.")]
public async Task JoinSelfRole(CommandContext ctx, DiscordRole role) public async Task JoinSelfRole(CommandContext ctx, DiscordRole role)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
} }
[Command("join")] [Command("join")]
[Description("Work in progress. Does nothing yet.")]
public async Task JoinSelfRole(CommandContext ctx, [RemainingText] string role) public async Task JoinSelfRole(CommandContext ctx, [RemainingText] string role)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
} }
[Command("leave")] [Command("leave")]
[Description("Work in progress. Does nothing yet.")]
public async Task LeaveSelfRole(CommandContext ctx, DiscordRole role) public async Task LeaveSelfRole(CommandContext ctx, DiscordRole role)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
} }
[Command("leave")] [Command("leave")]
[Description("Work in progress. Does nothing yet.")]
public async Task LeaveSelfRole(CommandContext ctx, [RemainingText] string role) public async Task LeaveSelfRole(CommandContext ctx, [RemainingText] string role)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
+8 -7
View File
@@ -115,14 +115,16 @@ namespace StarsiegeBot
// up next, let's register our commands // up next, let's register our commands
this.Commands.RegisterCommands<Commands>(); this.Commands.RegisterCommands<Commands>();
// this.Commands.RegisterCommands<SnappleFacts>();
this.Commands.RegisterCommands<BotSettings>(); // Main Folder. Test Items. this.Commands.RegisterCommands<BotSettings>(); // Main Folder. Test Items.
this.Commands.RegisterCommands<RoleManagement>(); // Main Folder. Test Items.
this.Commands.RegisterCommands<LevelRoleManagement>(); // Main Folder. Test Items.
this.Commands.RegisterCommands<GroupRoleManagement>(); // Main Folder. Test Items.
this.Commands.RegisterCommands<LevelManagement>(); // Main Folder. Test Items.
this.Commands.RegisterCommands<GroupManagement>(); // Main Folder. Test Items.
this.Commands.RegisterCommands<WelcomeMessage>(); // Main Folder. Test Items. this.Commands.RegisterCommands<WelcomeMessage>(); // Main Folder. Test Items.
this.Commands.RegisterCommands<PrefixManagement>();
// this.Commands.RegisterCommands<SnappleFacts>();
// this.Commands.RegisterCommands<RoleManagement>(); // Main Folder. Test Items.
// this.Commands.RegisterCommands<LevelRoleManagement>(); // Main Folder. Test Items.
// this.Commands.RegisterCommands<GroupRoleManagement>(); // Main Folder. Test Items.
// this.Commands.RegisterCommands<LevelManagement>(); // Main Folder. Test Items.
// this.Commands.RegisterCommands<GroupManagement>(); // Main Folder. Test Items.
// this.Commands.RegisterCommands<StarsiegeCommands>();
// All these commands are in the STARSIEGE folder. // All these commands are in the STARSIEGE folder.
//if (BotName.Contains("ssp")) //if (BotName.Contains("ssp"))
@@ -130,7 +132,6 @@ namespace StarsiegeBot
this.Commands.RegisterCommands<Quickchat>(); this.Commands.RegisterCommands<Quickchat>();
this.Commands.RegisterCommands<Functions>(); this.Commands.RegisterCommands<Functions>();
this.Commands.RegisterCommands<DeathMessages>(); this.Commands.RegisterCommands<DeathMessages>();
this.Commands.RegisterCommands<StarsiegeCommands>();
this.Commands.RegisterCommands<GameInfo>(); this.Commands.RegisterCommands<GameInfo>();
//} //}
Task thisTimerf = StartTimer(new CancellationToken()); Task thisTimerf = StartTimer(new CancellationToken());
+2 -1
View File
@@ -12,7 +12,7 @@ namespace StarsiegeBot
private Random rnd = new Random(); private Random rnd = new Random();
[Command("snapple"), Description("Get a Snapple \"Real Fact\".")] [Command("snapple"), Description("Get a Snapple \"Real Fact\".")]
public async Task Snapplefact(CommandContext ctx, int snapId = -1) public async Task Snapplefact(CommandContext ctx, [Description("[Optional] A Snapple Fact ID")]int snapId = -1)
{ {
if (snapId == -1) if (snapId == -1)
{ {
@@ -36,6 +36,7 @@ namespace StarsiegeBot
public SnappleFacts() public SnappleFacts()
{ {
Console.WriteLine("Snapple Commands Loaded");
this.facts = new string[] { "Animals that lay eggs don't have belly buttons.", this.facts = new string[] { "Animals that lay eggs don't have belly buttons.",
"Beavers can hold their breath for 45 minutes under water.", "Beavers can hold their breath for 45 minutes under water.",
"Slugs have four noses.", "Slugs have four noses.",
+2 -1
View File
@@ -55,6 +55,7 @@ namespace StarsiegeBot
} }
[Command("load")] [Command("load")]
[RequireOwner]
public async Task LoadDeathMessages(CommandContext ctx) public async Task LoadDeathMessages(CommandContext ctx)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
@@ -263,7 +264,7 @@ namespace StarsiegeBot
// Open the file to upload. // Open the file to upload.
FileStream sound = new FileStream($"deathmessages.cs", FileMode.Open); FileStream sound = new FileStream($"deathmessages.cs", FileMode.Open);
// Tell DSharp that we want to upload this file. // Tell DSharp that we want to upload this file.
msg.WithFile(sound); msg.WithFile("deathmessages.cs", sound);
// Add some content so its not a blank file. // Add some content so its not a blank file.
msg.Content ="Here is your request for a death message script."; msg.Content ="Here is your request for a death message script.";
// send that message. // send that message.
+1 -1
View File
@@ -213,7 +213,7 @@ namespace StarsiegeBot
} }
return $"Name: {name} || Title: {title} || Desc: {description} || Fields: {fs}"; return $"Name: {name} || Title: {title} || Desc: {description} || Fields: {{{fs}}}";
} }
} }
public class Fields public class Fields
+17 -7
View File
@@ -21,12 +21,14 @@ using System.Net;
namespace StarsiegeBot namespace StarsiegeBot
{ {
[Group("servers")] [Group("servers")]
[Description("Gives various reports on the game or master servers.")]
class GameInfo : BaseCommandModule class GameInfo : BaseCommandModule
{ {
private WebServerItems gameData; private WebServerItems gameData;
public GameInfo() public GameInfo()
{ {
Update(); Update();
Console.WriteLine("Starsiege Game Info Commands Loaded");
} }
private void Update() private void Update()
{ {
@@ -63,11 +65,17 @@ namespace StarsiegeBot
{ {
return; return;
} }
DiscordMessageBuilder msg = new DiscordMessageBuilder(); DiscordEmbedBuilder embed = new DiscordEmbedBuilder();
msg.Content = $""; embed.Title = "Master|Game Server Overview";
embed.Description = "Number of Master, and Game servers. Along with number of errors.";
embed.AddField("Masters", gameData.Masters.Length.ToString(),true);
embed.AddField("Games", gameData.Games.Length.ToString(),true);
embed.AddField("Errors", gameData.Errors.Length.ToString(),true);
await ctx.RespondAsync(embed);
} }
[Command("Errors")] [Command("Errors"), Aliases("e")]
[Description("Lists all the errors from the server listing.")]
public async Task ErrorsServer(CommandContext ctx) public async Task ErrorsServer(CommandContext ctx)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
@@ -92,7 +100,8 @@ namespace StarsiegeBot
await ctx.RespondAsync(msg); await ctx.RespondAsync(msg);
} }
[Command("Masters")] [Command("Masters"), Aliases("m")]
[Description("Gives all the master servers as a script to be improted into `master.cs`.")]
public async Task MasterServers (CommandContext ctx) public async Task MasterServers (CommandContext ctx)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
@@ -120,8 +129,9 @@ namespace StarsiegeBot
await ctx.RespondAsync(msg); await ctx.RespondAsync(msg);
} }
[Command("games")] [Command("games"), Aliases("g")]
public async Task GameServers(CommandContext ctx, int playerCount = 1) [Description("Currently: Lists games that have been started (Player dropped in). End Result: Lists all games that have a player in the server (either dropped in or not)")]
public async Task GameServers(CommandContext ctx, [Description("Number of players you want to check for. Game servers will need at least this meaning or more to be listed.")]int playerCount = 1)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
Update(); Update();
@@ -152,7 +162,7 @@ namespace StarsiegeBot
} }
if (count == 0) if (count == 0)
{ {
msg.Content = "No active servers. We're sorry"; msg.Content = "No servers matching your requirements. We're sorry";
} }
await ctx.RespondAsync(msg); await ctx.RespondAsync(msg);
} }
+5 -2
View File
@@ -52,6 +52,7 @@ namespace StarsiegeBot
} }
[Command("load"), RequireOwner] [Command("load"), RequireOwner]
[Description("[Onwer Only] Reloads the QuickChat files. If they exist. Also enables QC's if file is found.")]
public async Task LoadQuickChats(CommandContext ctx) public async Task LoadQuickChats(CommandContext ctx)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
@@ -185,7 +186,8 @@ namespace StarsiegeBot
} }
[Command("search"), Aliases("s")] [Command("search"), Aliases("s")]
public async Task SearchQuickChats(CommandContext ctx, [RemainingText] string toSearch) [Description("Searches all the [T]ext and [S]ound file names for the Search input.")]
public async Task SearchQuickChats(CommandContext ctx, [RemainingText,Description("What to search for.")] string toSearch)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
// If we're disabled, let them know. And exit out. // If we're disabled, let them know. And exit out.
@@ -228,7 +230,7 @@ namespace StarsiegeBot
{ {
msg.Content = "Here are your results."; msg.Content = "Here are your results.";
FileStream upload = new FileStream($"tempQC.txt", FileMode.Open); FileStream upload = new FileStream($"tempQC.txt", FileMode.Open);
msg.WithFile(upload); msg.WithFile("tempQC.txt", upload);
await ctx.RespondAsync(msg); await ctx.RespondAsync(msg);
upload.Close(); upload.Close();
} }
@@ -236,6 +238,7 @@ namespace StarsiegeBot
[Command("toggle"), Aliases("t")] [Command("toggle"), Aliases("t")]
[RequireOwner] [RequireOwner]
[Description("[Onwer only] Enables or disables, or checks status of QuickChats.")]
public async Task ToggleQC (CommandContext ctx, [RemainingText] string isEnabled = null) public async Task ToggleQC (CommandContext ctx, [RemainingText] string isEnabled = null)
{ {
await ctx.TriggerTypingAsync(); await ctx.TriggerTypingAsync();
-1
View File
@@ -16,7 +16,6 @@
<ItemGroup> <ItemGroup>
<Folder Include="Unicorn\" /> <Folder Include="Unicorn\" />
<Folder Include="Phoenix\" />
</ItemGroup> </ItemGroup>
</Project> </Project>