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

+94
View File
@@ -0,0 +1,94 @@
#pragma warning disable IDE0060 // Remove unused parameter
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
using DSharpPlus.VoiceNext;
using System.Text.RegularExpressions;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Text;
using DSharpPlus;
using DSharpPlus.CommandsNext.Exceptions;
using DSharpPlus.EventArgs;
using DSharpPlus.VoiceNext.Codec;
using Microsoft.Extensions.Logging;
using DSharpPlus.Interactivity;
using DSharpPlus.Interactivity.Extensions;
using System.Threading;
namespace StarsiegeBot
{
[Group("Group")]
[RequireGuild, RequirePermissions(Permissions.ManageRoles)]
class GroupManagement : BotSettings
{
public GroupManagement()
{
Console.WriteLine("Group Management Loaded.");
}
[GroupCommand]
public async Task ListGroups(CommandContext ctx)
{
await ctx.TriggerTypingAsync();
string gId = ctx.Guild.Id.ToString();
DiscordEmbedBuilder embed = new DiscordEmbedBuilder();
embed.WithTitle($"{ctx.Guild.Name} Groups");
embed.WithDescription("An overview of all role groups.");
foreach (KeyValuePair<string, Dictionary<string, int>> item in GuildSettings[gId].SelfRoles)
{
embed.AddField(item.Key, item.Value.Count.ToString());
}
await ctx.RespondAsync(embed);
}
[Command("add")]
public async Task AddGroup(CommandContext ctx, [RemainingText, Description("Group to create.")] string groupName)
{
await ctx.TriggerTypingAsync();
string gId = ctx.Guild.Id.ToString();
if (GuildSettings[gId].SelfRoles.ContainsKey(groupName))
{
await ctx.RespondAsync($"The group `{groupName}` already exists.");
}
else
{
var temp = new Dictionary<string, int>();
GuildSettings[gId].SelfRoles.Add(groupName, temp);
await ctx.RespondAsync($"The group `{groupName}` was added.");
}
}
// TODO: Delete all roles or assign new group?
[Command("delete")]
public async Task RemoveGroup(CommandContext ctx, [RemainingText, Description("Group to delete")] string groupName)
{
await ctx.TriggerTypingAsync();
string gId = ctx.Guild.Id.ToString();
if (GuildSettings[gId].SelfRoles.ContainsKey(groupName))
{
GuildSettings[gId].SelfRoles.Remove(groupName);
await ctx.RespondAsync($"Group `{groupName}` removed.");
}
else
{
await ctx.RespondAsync($"The group `{groupName}` doesn't exist.");
}
}
[Command("edit")]
[Description("This is under construction. Does nothing yet.")]
public async Task EditGroup(CommandContext ctx, [RemainingText] string groupInfo)
{
await ctx.TriggerTypingAsync();
// string gId = ctx.Guild.Id.ToString();
}
}
}
@@ -0,0 +1,67 @@
#pragma warning disable IDE0060 // Remove unused parameter
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
using DSharpPlus.VoiceNext;
using System.Text.RegularExpressions;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Text;
using DSharpPlus;
using DSharpPlus.CommandsNext.Exceptions;
using DSharpPlus.EventArgs;
using DSharpPlus.VoiceNext.Codec;
using Microsoft.Extensions.Logging;
using DSharpPlus.Interactivity;
using DSharpPlus.Interactivity.Extensions;
using System.Threading;
namespace StarsiegeBot
{
[Group("GroupRole")]
[Description("Work in progress. Does nothing yet.")]
[RequireGuild, RequirePermissions(Permissions.ManageRoles)]
class GroupRoleManagement : BotSettings
{
public GroupRoleManagement()
{
Console.WriteLine("Group Role Management Loaded.");
}
[GroupCommand]
public async Task ListGroups(CommandContext ctx)
{
await ctx.TriggerTypingAsync();
}
[Command("add")]
[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();
if (price == -1)
{
return;
}
}
[Command("delete")]
[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();
}
[Command("Edit")]
[Description("Work in progress. Does nothing yet.")]
public async Task EditRole(CommandContext ctx, DiscordRole role, int newPrice = 0, [RemainingText] string newGroup = null)
{
await ctx.TriggerTypingAsync();
}
}
}
+65
View File
@@ -0,0 +1,65 @@
#pragma warning disable IDE0060 // Remove unused parameter
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
using DSharpPlus.VoiceNext;
using System.Text.RegularExpressions;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Text;
using DSharpPlus;
using DSharpPlus.CommandsNext.Exceptions;
using DSharpPlus.EventArgs;
using DSharpPlus.VoiceNext.Codec;
using Microsoft.Extensions.Logging;
using DSharpPlus.Interactivity;
using DSharpPlus.Interactivity.Extensions;
using System.Threading;
namespace StarsiegeBot
{
[Group("Level")]
[RequireGuild, RequirePermissions(Permissions.ManageRoles)]
[Description("Work in progress. Does nothing yet.")]
class LevelManagement : BotSettings
{
public LevelManagement()
{
Console.WriteLine("Level Management Loaded.");
}
[GroupCommand]
[Description("Work in progress. Does nothing yet.")]
public async Task ListLevels(CommandContext ctx)
{
await ctx.TriggerTypingAsync();
}
[Command("AddLevel"), Aliases("al")]
[Description("Work in progress. Does nothing yet.")]
public async Task AddLevel(CommandContext ctx, int newLevelGroup)
{
await ctx.TriggerTypingAsync();
}
[Command("DeleteLevel"), Aliases("dl")]
[Description("Work in progress. Does nothing yet.")]
public async Task DeleteLevel(CommandContext ctx, int oldLevelGroup)
{
await ctx.TriggerTypingAsync();
}
[Command("edit")]
[Description("Work in progress. Does nothing yet.")]
public async Task EditLevel (CommandContext ctx, int oldLeve, int newLevel)
{
await ctx.TriggerTypingAsync();
}
}
}
@@ -0,0 +1,63 @@
#pragma warning disable IDE0060 // Remove unused parameter
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
using DSharpPlus.VoiceNext;
using System.Text.RegularExpressions;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Text;
using DSharpPlus;
using DSharpPlus.CommandsNext.Exceptions;
using DSharpPlus.EventArgs;
using DSharpPlus.VoiceNext.Codec;
using Microsoft.Extensions.Logging;
using DSharpPlus.Interactivity;
using DSharpPlus.Interactivity.Extensions;
using System.Threading;
namespace StarsiegeBot
{
[Group("LevelRole")]
[RequireGuild, RequirePermissions(Permissions.ManageRoles)]
class LevelRoleManagement : BotSettings
{
public LevelRoleManagement()
{
Console.WriteLine("Level Role Management Loaded.");
}
[Command("edit")]
[Description("Work in progress. Does nothing yet.")]
public async Task EditRole(CommandContext ctx, int oldLevel, int newLevel, DiscordRole role)
{
await ctx.TriggerTypingAsync();
}
[Command("edit")]
[Description("Work in progress. Does nothing yet.")]
public async Task EditRole(CommandContext ctx, int newLevel, [RemainingText] string role)
{
await ctx.TriggerTypingAsync();
}
[Command("remove")]
[Description("Work in progress. Does nothing yet.")]
public async Task RemoveRole(CommandContext ctx, DiscordRole role)
{
await ctx.TriggerTypingAsync();
}
[Command("remove")]
[Description("Work in progress. Does nothing yet.")]
public async Task RemoveRole(CommandContext ctx, [RemainingText] string roleName)
{
await ctx.TriggerTypingAsync();
}
}
}
+72
View File
@@ -0,0 +1,72 @@
#pragma warning disable IDE0060 // Remove unused parameter
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
using DSharpPlus.VoiceNext;
using System.Text.RegularExpressions;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Text;
using DSharpPlus;
using DSharpPlus.CommandsNext.Exceptions;
using DSharpPlus.EventArgs;
using DSharpPlus.VoiceNext.Codec;
using Microsoft.Extensions.Logging;
using DSharpPlus.Interactivity;
using DSharpPlus.Interactivity.Extensions;
using System.Threading;
namespace StarsiegeBot
{
[Group("role")]
[RequireGuild,RequirePermissions(Permissions.ManageRoles)]
class RoleManagement : BotSettings
{
public RoleManagement()
{
Console.WriteLine("Role Management Loaded.");
}
[Command("join")]
[Description("Work in progress. Does nothing yet.")]
public async Task JoinSelfRole(CommandContext ctx, DiscordRole role)
{
await ctx.TriggerTypingAsync();
}
[Command("join")]
[Description("Work in progress. Does nothing yet.")]
public async Task JoinSelfRole(CommandContext ctx, [RemainingText] string role)
{
await ctx.TriggerTypingAsync();
}
[Command("leave")]
[Description("Work in progress. Does nothing yet.")]
public async Task LeaveSelfRole(CommandContext ctx, DiscordRole role)
{
await ctx.TriggerTypingAsync();
}
[Command("leave")]
[Description("Work in progress. Does nothing yet.")]
public async Task LeaveSelfRole(CommandContext ctx, [RemainingText] string role)
{
await ctx.TriggerTypingAsync();
}
private bool VerifiedRole(DiscordGuild guild, DiscordRole role)
{
return false;
}
private bool VerifiedRole(DiscordGuild guild, string role)
{
return false;
}
}
}