Added general bot commands NewStatus, and NewName, both RequireOwner to evoke.

This commit is contained in:
Chris Darnell committed 2021-05-04 05:05:59 -07:00
1 parent 147c165e62
commit afca839596
7 files changed
+241 -110

No files matched your search

+8 -8
View File
@@ -19,7 +19,7 @@ namespace StarsiegeBot
Console.WriteLine("Group Management Loaded.");
}
[GroupCommand]
[GroupCommand, Aliases("view")]
public async Task ListGroups(CommandContext ctx)
{
await ctx.TriggerTypingAsync();
@@ -69,13 +69,13 @@ namespace StarsiegeBot
}
}
[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();
//[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();
}
//}
}
}
+39 -5
View File
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace StarsiegeBot
{
[Group("GroupRole")]
[Group("GroupRole"), Aliases("gr")]
[Description("Work in progress. Does nothing yet.")]
[RequireGuild, RequirePermissions(Permissions.ManageRoles)]
class GroupRoleManagement : BotSettings
@@ -27,20 +27,43 @@ namespace StarsiegeBot
[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)
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."), RemainingText] string groupName = null)
{
await ctx.TriggerTypingAsync();
if (price == -1)
price = Math.Abs(price);
// Fix price.
// Verify group exists.
// Since we allow roles to be in several groups, dont have to verify that.
//
string gId = ctx.Guild.Id.ToString();
if (GuildSettings[gId].SelfRoles.ContainsKey(groupName))
{
return;
GuildSettings[gId].SelfRoles[groupName].Add(role.Id.ToString(), price);
await ctx.RespondAsync(StartEmbed($"{role.Mention} added to the group `{groupName}` with the price of {price}"));
}
else
{
// group not found, `Create it?` or `Cancel`?
}
}
[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)
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."), RemainingText] string group = null)
{
await ctx.TriggerTypingAsync();
// Verify role is in a group.
// Verify group selected exists.
// If group null, remove from all groups?
}
[Command("Edit")]
@@ -49,5 +72,16 @@ namespace StarsiegeBot
{
await ctx.TriggerTypingAsync();
}
private DiscordEmbedBuilder StartEmbed(string desc)
{
DiscordEmbedBuilder embed = new DiscordEmbedBuilder
{
Description = desc,
Color = Program.colours[3]
};
return embed;
}
}
}