Answer the question
In order to leave comments, you need to log in
How to send a message to all server admins where there is a message bot (discord.py)?
I have a discord bot on ~4 servers at the same time. I often update the bot and fix bugs, add new features. I had an idea to create messages to server moderators about an upcoming or upcoming update. For example, there is a message text and you need to confirm this through the console. I know about the " await asyncio.run_coroutine_threadsafe()
" method, but I don't know how to apply it correctly.
Here is a small code example:
async def send_up_to_date_message():
update_message = f''''''
owners = #админы серверов
owners.send()
@bot.command()
@commands.has_permissions(administrator = True)
async def send_update_message():
answer = input('Вы действительно хотите отправить сообщение о обновлении бота? ')
if answer == 'yes':
await asyncio.run_coroutine_threadsafe(send_update_message)
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