I have a program that looks like this:
import things
import discord
def on_thing_happen (variable):
get_info()
do thing()
# This is where I want to send a message in Discord
For reasons, the rest of my code cannot work in an async function.
Is there any way to do this? I cannot use an async def.
send
event from a sync function it can cause some weird behavior. I'm not sure what blocking code you are trying to run, but it will likely be better to have a standard async function that runs your blocking function in an asyncio executor and you can useawait send
as normal - derw