You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"asyncio.run() cannot be called from a running event loop")"
Reproduction Steps
Debugging in Interactive Shell.
client.run('REDACTEDTOKEN') ->
importdiscordimportosimportasynciofromcollectionsimportdequeimportollamaimportthreadingintents=discord.Intents.all()
intents.members=Trueclient=discord.Client(intents=intents, heartbeat_timeout=60)
@client.eventasyncdefon_ready():
print(f'Logged in as {client.user}')
# Start the queue processing taskawaitasyncio.create_task(process_queue())
client.run('REDACTED_TOKEN')
Minimal Reproducible Code
RuntimeErrorTraceback (mostrecentcalllast)
File/home/alca/projects/discord_ai.py:105102# Start the queue processing task103awaitasyncio.create_task(process_queue())
-->105client.run('')
File~/projects/.bt/lib/python3.11/site-packages/discord/client.py:860, inClient.run(self, token, reconnect, log_handler, log_formatter, log_level, root_logger)
852utils.setup_logging(
853handler=log_handler,
854formatter=log_formatter,
855level=log_level,
856root=root_logger,
857 )
859try:
-->860asyncio.run(runner())
861exceptKeyboardInterrupt:
862# nothing to do here863# `asyncio.run` handles the loop cleanup864# and `self.start` closes all sockets and the HTTPClient instance.865returnFile/usr/lib/python3.11/asyncio/runners.py:186, inrun(main, debug)
161 """Execute the coroutine and return the result.
162
...
187 "asyncio.run() cannot be called from a running event loop")
189withRunner(debug=debug) asrunner:
190returnrunner.run(main)
RuntimeError: asyncio.run() cannotbecalledfromarunningeventloop
Summary
"asyncio.run() cannot be called from a running event loop")"
Reproduction Steps
Debugging in Interactive Shell.
client.run('REDACTEDTOKEN') ->
Minimal Reproducible Code
Expected Results
Run the Bot, what a dumb timewasting question.
Actual Results
Stop annoying questions, ffs.
Intents
... ALL!
System Information
Python v3.11.7-final
Checklist
Additional Context
No response
The text was updated successfully, but these errors were encountered: