public async Task KickAsync(CachedMember member, [Remainder] string?reason = null)
            {
                if (member.Id == Context.User.Id)
                {
                    return;
                }

                if (member.Id == Context.Guild !.OwnerId)
                {
                    await ReplyErrorAsync(Localization.AdministrationCannotKickOwner);

                    return;
                }

                if (Context.CurrentMember !.CheckHierarchy(member) <= 0)
                {
                    await ReplyErrorAsync(Localization.AdministrationUserAboveMe);

                    return;
                }

                if (((CachedMember)Context.User).CheckHierarchy(member) <= 0)
                {
                    await ReplyErrorAsync(Localization.AdministrationUserAbove);

                    return;
                }

                await SendMessageAsync(member, Localization.AdministrationUserKicked, Localization.AdministrationKickedFrom, reason);

                await member.KickAsync();
            }
Exemplo n.º 2
0
        public async Task KickAsync(
            [Description("Member to kick")] CachedMember member,
            [Description("Reason of the kick")][Remainder] string reason)
        {
            await member.KickAsync(RestRequestOptions.FromReason(reason));

            await RespondEmbedAsync($"{member.FullName()} was kicked. ({reason})");
        }