Answer the question
In order to leave comments, you need to log in
How to change the prefix with a command?
There were already such questions on Habré, but I did not find a suitable answer. In general, I want to change the prefix by command, and take the prefix itself from the database. The problem is in the function call. More precisely, I don’t quite understand how you can take the id of the server for which you need to get the prefix.
def get_prefix(guild):
with con:
cur = con.cursor()
cur.execute(f"SELECT prefix FROM simple_voice.server_{guild.id};")
rows = cur.fetchall()
bot: commands.Bot = commands.Bot(command_prefix=get_prefix(тут нужно передавать сервер))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question