Answer the question
In order to leave comments, you need to log in
Access / Deny to the command?
Access and prohibition to the command. How to allow and forbid the user to use the selected command?
For example: I am allowed to use it, but others are not.
Besides, how to delete a command by a bot, after writing it?
Example: I wrote a command, after which the bot sent a message and deleted the command.
Answer the question
In order to leave comments, you need to log in
@Client.command(pass_context=True)
@commands.has_permissions(manage_messages=True)
async def ping(ctx):
await ctx.message.delete()
await ctx.send('Pong!')
well, like
if chat_id != admin_id: return False # только для админа
MessageDelete
If there is something like that.
Access and prohibition to the command. How to allow and forbid the user to use the selected command?
For example: I am allowed to use it, but others are not.
if (total_say_ban > 0.80) and message.chat.id == 441945234:
user_name = message.text.split('@')[1].strip()
print(total_say_ban)
# Бан пользователя>
conn = sqlite3.connect("users.db")
cursor = conn.cursor()
# Находим ублюдка по его username, меняем значение rules на False
sql = """
UPDATE white_list
SET rules = 'False'
WHERE user_name=?
"""
cursor.execute(sql, [user_name])
fetch_id = cursor.fetchone()
conn.commit()
bot.send_message(user_id, f"Пользователь @{user_name} забанен.")
@client.command()
@commands.has_any_role( ID, ID, ID ) # ID роли, можно хоть сколько, можно хоть один
async def mute( ctx, member:discord.Member,time:int, * ,reason ):
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question