Skip to content

Commit

Permalink
Use consistent Option descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed May 4, 2022
1 parent 6153801 commit 1d0980a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Hammer/CommandModules/BanCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;
using BrackeysBot.API.Extensions;
using BrackeysBot.Core.API;
Expand Down Expand Up @@ -42,9 +42,9 @@ public BanCommand(BanService banService, RuleService ruleService)
[SlashCommand("ban", "Temporarily or permanently bans a user.", false)]
[SlashRequireGuild]
public async Task BanAsync(InteractionContext context,
[Option("user", "The user to mute")] DiscordUser user,
[Option("reason", "The reason for the mute")] string? reason = null,
[Option("duration", "The duration of the mute")] string? durationRaw = null,
[Option("user", "The user to ban.")] DiscordUser user,
[Option("reason", "The reason for the ban.")] string? reason = null,
[Option("duration", "The duration of the ban.")] string? durationRaw = null,
[Option("rule", "The rule which was broken."), Autocomplete(typeof(RuleAutocompleteProvider))] long? ruleBroken = null)
{
await context.DeferAsync(true).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal sealed partial class InfractionCommand
[SlashRequireGuild]
public async Task CopyAsync(InteractionContext context,
[Option("source", "The user whose infractions to copy.")] DiscordUser source,
[Option("destination", "The user whose infractions to copy.")] DiscordUser destination)
[Option("destination", "The user who will acquire the copied infractions.")] DiscordUser destination)
{
await context.DeferAsync(true).ConfigureAwait(false);

Expand Down
10 changes: 5 additions & 5 deletions Hammer/CommandModules/Infractions/InfractionCommand.Delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ namespace Hammer.CommandModules.Infractions;

internal sealed partial class InfractionCommand
{
[SlashCommand("delete", "Deletes an infraction with the specified ID.", false)]
[SlashCommand("delete", "Deletes an infraction.", false)]
[SlashRequireGuild]
public async Task DeleteAsync(InteractionContext context,
[Autocomplete(typeof(InfractionAutocompleteProvider))] [Option("id", "The ID of the infraction to delete.")]
long id)
[Autocomplete(typeof(InfractionAutocompleteProvider))] [Option("infraction", "The infraction to delete.")]
long infractionId)
{
await context.DeferAsync(true).ConfigureAwait(false);
var embed = new DiscordEmbedBuilder();

Infraction? infraction = _infractionService.GetInfraction(id);
Infraction? infraction = _infractionService.GetInfraction(infractionId);
if (infraction is null)
{
embed.WithColor(0xFF0000);
embed.WithTitle("Infraction not found");
embed.WithDescription($"The infraction with the ID `{id}` was not found.");
embed.WithDescription($"The infraction with the ID `{infractionId}` was not found.");
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions Hammer/CommandModules/Infractions/InfractionCommand.Move.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ internal sealed partial class InfractionCommand
[SlashCommand("move", "Moves all infractions from one user to another.", false)]
[SlashRequireGuild]
public async Task MoveAsync(InteractionContext context,
[Option("source", "The user whose infractions to copy.")] DiscordUser source,
[Option("destination", "The user whose infractions to copy.")] DiscordUser destination)
[Option("source", "The user whose infractions to move.")] DiscordUser source,
[Option("destination", "The user who will acquire the moved infractions.")] DiscordUser destination)
{
await context.DeferAsync(true).ConfigureAwait(false);

Expand Down
8 changes: 3 additions & 5 deletions Hammer/CommandModules/UnbanCommandModule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;
using BrackeysBot.API.Extensions;
using BrackeysBot.Core.API;
Expand Down Expand Up @@ -34,8 +34,7 @@ public UnbanCommandModule(BanService banService)
[Description("Unbans a user.")]
[RequirePermissionLevel(PermissionLevel.Administrator)]
public async Task UnbanCommandAsync(CommandContext context, [Description("The ID of the user to unban.")] ulong userId,
[Description("The reason for the ban revocation."), RemainingText]
string? reason = null)
[Description("The reason for the ban revocation."), RemainingText] string? reason = null)
{
await context.AcknowledgeAsync().ConfigureAwait(false);

Expand Down Expand Up @@ -63,8 +62,7 @@ public async Task UnbanCommandAsync(CommandContext context, [Description("The ID
[Description("Unbans a user.")]
[RequirePermissionLevel(PermissionLevel.Administrator)]
public async Task UnbanCommandAsync(CommandContext context, [Description("The user to unban.")] DiscordUser user,
[Description("The reason for the ban revocation."), RemainingText]
string? reason = null)
[Description("The reason for the ban revocation."), RemainingText] string? reason = null)
{
await context.AcknowledgeAsync().ConfigureAwait(false);

Expand Down

0 comments on commit 1d0980a

Please sign in to comment.