示例#1
0
        public async Task mKick(string user, [Remainder] string reason)
        {
            try
            {
                user = user.Substring(2);
                user = user.Remove(18);
                var userID            = Context.Guild.GetUser(Convert.ToUInt64(user));
                Discord.IDMChannel dm = await userID.GetOrCreateDMChannelAsync();

                await dm.SendMessageAsync($"You have been kicked from {Context.Guild.Name} with the reason: {reason}");

                await dm.CloseAsync();

                await userID.KickAsync(reason);
                await ReplyAsync($"{Context.Message.Author.Mention} has kicked {userID}.\nReaon:\n`{reason}`");
            }
            catch
            {
                await ReplyAsync("Couldn't kick user.\nPlease make sure that you have mentioned the user you want to kick.");
            }
        }