Removed extra spaces. Removed double \r\n across all code files.

This commit is contained in:
Christopher Darnell committed 2021-05-06 20:07:03 -07:00
1 parent 91d6d1531b
commit 5bb1b43e81
19 files changed
+68 -389

No files matched your search

+1 -11
View File
@@ -7,7 +7,6 @@ using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace StarsiegeBot
{
[Group("Group")]
@@ -18,14 +17,11 @@ namespace StarsiegeBot
{
Console.WriteLine("Group Management Loaded.");
}
[GroupCommand, Aliases("view")]
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)
@@ -34,11 +30,9 @@ namespace StarsiegeBot
}
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))
{
@@ -51,12 +45,10 @@ namespace StarsiegeBot
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))
{
@@ -68,14 +60,12 @@ namespace StarsiegeBot
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();
//}
}
}
+1 -16
View File
@@ -6,7 +6,6 @@ using DSharpPlus.Entities;
using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace StarsiegeBot
{
[Group("GroupRole"), Aliases("gr")]
@@ -18,13 +17,10 @@ namespace StarsiegeBot
{
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,
@@ -32,15 +28,12 @@ namespace StarsiegeBot
[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();
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))
{
GuildSettings[gId].SelfRoles[groupName].Add(role.Id.ToString(), price);
@@ -49,31 +42,23 @@ namespace StarsiegeBot
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."), 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")]
[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();
}
private DiscordEmbedBuilder StartEmbed(string desc)
{
DiscordEmbedBuilder embed = new DiscordEmbedBuilder
-10
View File
@@ -5,7 +5,6 @@ using DSharpPlus.CommandsNext.Attributes;
using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace StarsiegeBot
{
[Group("Level")]
@@ -17,34 +16,25 @@ namespace StarsiegeBot
{
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();
}
}
}
@@ -6,7 +6,6 @@ using DSharpPlus.Entities;
using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace StarsiegeBot
{
[Group("LevelRole")]
@@ -17,33 +16,25 @@ namespace StarsiegeBot
{
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();
}
}
}
-10
View File
@@ -6,7 +6,6 @@ using DSharpPlus.Entities;
using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace StarsiegeBot
{
[Group("role")]
@@ -17,35 +16,26 @@ namespace StarsiegeBot
{
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;