Answer the question
In order to leave comments, you need to log in
How to blacklist discord.py?
you need to make a black list of servers, that is, so that the commands on a certain discord server would not work (what would I specify the id and that's it)
Example:
me: .help
Bot: I do not work on this server!
Answer the question
In order to leave comments, you need to log in
Here it is correct to ask a question, how to learn the basics of Python? Then this question would not arise. Just do a check before executing the command. If the command was sent from a blacklisted server in the form of a list with guild IDs, then send the required message and do not execute the command.
Create a global check:
commands.Bot.check
BLACKLISTED_GUILDS = [803958338191541161, ...]
...
@bot.check
def check_commands(ctx):
return ctx.guild.id not in BLACKLISTED_GUILDS
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question