diff --git a/Commands/BanCmds.cs b/Commands/BanCmds.cs index 6e61f994..4173eebb 100644 --- a/Commands/BanCmds.cs +++ b/Commands/BanCmds.cs @@ -114,7 +114,7 @@ public async Task BanSlashCommand(SlashCommandContext ctx, [Description("Unbans a user who has been previously banned.")] [AllowedProcessors(typeof(SlashCommandProcessor), typeof(TextCommandProcessor))] [HomeServer, RequireHomeserverPerm(ServerPermLevel.Moderator), RequirePermissions(permissions: DiscordPermission.BanMembers)] - public async Task UnbanCmd(CommandContext ctx, [Description("The user to unban, usually a mention or ID")] DiscordUser targetUser, [Description("Used in audit log only currently")] string reason = "No reason specified.") + public async Task UnbanCmd(CommandContext ctx, [Description("The user to unban, usually a mention or ID")] DiscordUser targetUser, [RemainingText, Description("Used in audit log only currently")] string reason = "No reason specified.") { if ((await Program.db.HashExistsAsync("bans", targetUser.Id))) { diff --git a/Commands/KickCmds.cs b/Commands/KickCmds.cs index bd00d764..76fd6d9a 100644 --- a/Commands/KickCmds.cs +++ b/Commands/KickCmds.cs @@ -7,13 +7,16 @@ public class KickCmds [Description("Kicks a user, removing them from the server until they rejoin.")] [AllowedProcessors(typeof(SlashCommandProcessor), typeof(TextCommandProcessor))] [RequireHomeserverPerm(ServerPermLevel.Moderator), RequirePermissions(DiscordPermission.KickMembers)] - public async Task KickCmd(CommandContext ctx, [Parameter("user"), Description("The user you want to kick from the server.")] DiscordUser target, [Parameter("reason"), Description("The reason for kicking this user.")] string reason = "No reason specified.") + public async Task KickCmd(CommandContext ctx, [Parameter("user"), Description("The user you want to kick from the server.")] DiscordUser target, [Parameter("reason"), Description("The reason for kicking this user."), RemainingText] string reason = "No reason specified.") { if (target.IsBot) { await ctx.RespondAsync($"{Program.cfgjson.Emoji.Error} To prevent accidents, I won't kick bots. If you really need to do this, do it manually in Discord."); return; } + + if (ctx is TextCommandContext) + await ctx.As().Message.DeleteAsync(); reason = reason.Replace("`", "\\`").Replace("*", "\\*"); @@ -34,7 +37,8 @@ public class KickCmds { await KickAndLogAsync(member, reason, ctx.Member); await ctx.Channel.SendMessageAsync($"{Program.cfgjson.Emoji.Ejected} {target.Mention} has been kicked: **{reason}**"); - await ctx.RespondAsync($"{Program.cfgjson.Emoji.Success} Done!", ephemeral: true); + if (ctx is SlashCommandContext) + await ctx.RespondAsync($"{Program.cfgjson.Emoji.Success} Done!", ephemeral: true); return; } else