Skip to content

Commit 4cc22a8

Browse files
committed
grant: add audit reason, update description
1 parent 977318b commit 4cc22a8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Commands/RoleCmds.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ namespace Cliptok.Commands
33
public class RoleCmds
44
{
55
[Command("grant")]
6-
[Description("Grant a user Tier 1, bypassing any verification requirements.")]
6+
[Description("Grant a user access to the server, bypassing any verification requirements.")]
77
[AllowedProcessors(typeof(SlashCommandProcessor), typeof(TextCommandProcessor))]
88
[RequireHomeserverPerm(ServerPermLevel.TrialModerator), RequirePermissions(DiscordPermission.ModerateMembers)]
9-
public async Task Grant(CommandContext ctx, [Parameter("user"), Description("The user to grant Tier 1 to.")] DiscordUser user)
9+
public async Task Grant(CommandContext ctx, [Parameter("user"), Description("The user to grant server access to.")] DiscordUser user)
1010
{
1111
DiscordMember member = default;
1212
try
@@ -31,7 +31,11 @@ public async Task Grant(CommandContext ctx, [Parameter("user"), Description("The
3131
return;
3232
}
3333

34-
await member.ModifyAsync(x => x.MemberFlags = (DiscordMemberFlags)member.MemberFlags | DiscordMemberFlags.BypassesVerification);
34+
await member.ModifyAsync(x =>
35+
{
36+
x.MemberFlags = (DiscordMemberFlags)member.MemberFlags | DiscordMemberFlags.BypassesVerification;
37+
x.AuditLogReason = $"grant command used by {DiscordHelpers.UniqueUsername(ctx.User)}";
38+
});
3539

3640
await ctx.RespondAsync($"{Program.cfgjson.Emoji.Success} {member.Mention} can now access the server!");
3741
}

0 commit comments

Comments
 (0)