diff --git a/samples/02_commands_framework/Modules/PublicModule.cs b/samples/02_commands_framework/Modules/PublicModule.cs index 0b2379d15..542dbfd25 100644 --- a/samples/02_commands_framework/Modules/PublicModule.cs +++ b/samples/02_commands_framework/Modules/PublicModule.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using Discord; using Discord.Commands; using _02_commands_framework.Services; +using System; namespace _02_commands_framework.Modules { @@ -52,14 +53,24 @@ namespace _02_commands_framework.Modules // Kick a user [Command("kick")] [RequireContext(ContextType.Guild)] - // make sure the user invoking the coomand can kick + // make sure the user invoking the command can kick [RequireUserPermission(GuildPermission.KickMembers)] // make sure the bot itself can kick [RequireBotPermission(GuildPermission.KickMembers)] public async Task KickUserAsync(IGuildUser user, [Remainder] string reason = null) { + // Creates the pattern TextBlock + EmbedBuilder builder = new EmbedBuilder(); + + builder.WithTitle(user.Username + " kicked from server!") + .WithColor(Color.Orange) + .WithDescription("by " + + $"{Context.User.Username}" + + Environment.NewLine + + "Reason: " + reason); + await user.KickAsync(reason, null); - await ReplyAsync("ok!"); + await ReplyAsync("", false, builder.Build()); } // [Remainder] takes the rest of the command's arguments as one argument, rather than splitting every space @@ -72,18 +83,5 @@ namespace _02_commands_framework.Modules [Command("list")] public Task ListAsync(params string[] objects) => ReplyAsync("You listed: " + string.Join("; ", objects)); - - // Can be used to example put information - [Command("info")] - public async Task InformationAsync() - { - // Creates the pattern TextBlock - EmbedBuilder builder = new EmbedBuilder(); - //builder.AddField("title", ""); - builder.WithTitle("This is Discord!") - .WithColor(Color.Orange); - - await ReplyAsync("", false, builder.Build()); - } } }