import discord
#from database import Db
import asyncio
from plugins.messages import Messages
class Test(discord.Client):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs, intents=discord.Intents.all())
self.redis_url = kwargs.get('redis_url')
self.mongo_url = kwargs.get('mongo_url')
self.token = kwargs.get('token')
def run(self, *args):
asyncio.run(self.start(token=self.token))
async def on_ready(self):
self.loop.create_task(Messages())
print('hello!')
import asyncio
class Messages():
async def on_message(self, message):
print(message)
Task exception was never retrieved
future: <Task finished name='Task-6' coro=<ConnectionState._delay_ready() done, defined at D:\Python\Lib\site-packages\discord\state.py:608> exception=AttributeError("'_MissingSentinel' object has no attribute 'set'")>
Traceback (most recent call last):
File "D:\Python\Lib\site-packages\discord\state.py", line 651, in _delay_ready
self.call_handlers('ready')
~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "D:\Python\Lib\site-packages\discord\state.py", line 345, in call_handlers
func(*args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\site-packages\discord\client.py", line 345, in _handle_ready
self._ready.set()
^^^^^^^^^^^^^^^
AttributeError: '_MissingSentinel' object has no attribute 'set'