#How to ban every user from server
1 messages · Page 1 of 1 (latest)
This sounds vaguely ostentatious.
It's also bound to get your bot flagged for abusive behavior.
GuildGetAllMembersAsync- Use
foreach - Do anything what do you want with each user
¯_(ツ)_/¯
ok
I think there is a problem with users who have space in their names
it dont ban them only the ones without space
Your bot doesn't use nicknames to ban. Bot need only id for this. So the problem can't be in nicknames.
Can you send your code or error stack trace?
there is no error
it just leave users with space
Second line, you are using ASYNC method without await
lmao i havent noticed
but still not banning them
Thats his nickname
everyother friend got banned but this one not
I still need an error stack trace
Probably bot just don't have permissions to do smth with him
yes administrator
Triggered whenever a command throws an exception during execution.
(CommandsNextExtension)
Thanks
Ensure it has proper hierarchy as well.
This guy can be a server creator 
i am server creator
Use try catch or (give me a minute)
I said ensure your bot has proper hierarchy.
You cannot ban someone who has the same or higher role than you
Keep in mind <@&379378609942560770> counts as a role, too.
its on top there is no other roles exept the bot role
Well, see if command errored fires.
I suspect becuase you're trying to ban everyone, you're trying to ban yourself (the bot) and the exception is taking you out of the loop.
Hans tag command error
If your command is unresponsive, try checking the following:
* Hook your CommandErrored event on your CommandsNext instance and print the exception to the console, like as follows:
// somewhere in your code: var commands = client.UseCommandsNext();
commands.CommandErrored += (cnext, e) =>
{
Console.WriteLine($"Ze command went kaput: {e.Exception}");
return Task.CompletedTask;
};
Now, if your command is throwing an exception, it'll be revealed to the console.
* If you're in an event handler, try making your handler non-blocking. By default, the WebSocket handler dispatches events on the same branch that it uses to receive network data. This means that even though your event handler is asynchronous, its completion is always waited before any further socket messages are processed. If your event handler performs complex tasks, this can cause brief unresponsiveness or, in the worst case, deadlocks. Usually, wrapping your event handler in a Task.Run block should be enough to remedy this issue.
* If neither of the above solutions work, this could mean that there is an issue elsewhere in your code, or, very rarely, a bug in the library. In such case, post as much of the offending code as possible and, if possible, provide steps to reproduce the issue.
It banned every user with no spaces in nickname
hmm another user is not banned and he has no spaces
Unauthorized
strange cus bot has admin
but then why it banned some guys and some just cant
Read the message.
This includes yourself.