PilotsTradeNetwork / EDStockTraderProject

5 stars 2 forks source link

WMM Stock tracking not working #23

Closed mvcircelli closed 3 years ago

mvcircelli commented 3 years ago

Originally, I was under the impression that the bot just couldn't see the wmm-stock channel, though I checked that it responds to a ;ping in the channel, so that must mean it can view and access it.

Seems like the on_ready() function responsible for initializing the wmm stock messages crashes on startup, so the wmm loop is never initialized. here's the included error:

Sep 24 15:06:15 ptnbots stockbot[1347]: _ClientEventTask exception was never retrieved
Sep 24 15:06:15 ptnbots stockbot[1347]: future: <ClientEventTask state=finished event=on_ready coro=<function on_ready at 0x7f7465db1598> 
Sep 24 15:06:15 ptnbots stockbot[1347]: Traceback (most recent call last):
Sep 24 15:06:15 ptnbots stockbot[1347]:   File "/usr/local/lib/python3.7/dist-packages/discord/client.py", line 348, in _run_event
Sep 24 15:06:15 ptnbots stockbot[1347]:     await self.on_error(event_name, *args, **kwargs)
Sep 24 15:06:15 ptnbots stockbot[1347]:   File "/usr/local/lib/python3.7/dist-packages/discord/client.py", line 343, in _run_event
Sep 24 15:06:15 ptnbots stockbot[1347]:     await coro(*args, **kwargs)
Sep 24 15:06:15 ptnbots stockbot[1347]:   File "/home/htcmatthewcircelli/EDStockTraderProject/bot.py", line 55, in on_ready
Sep 24 15:06:15 ptnbots stockbot[1347]:     f'{bot.user.name} is connected to \n'
Sep 24 15:06:15 ptnbots stockbot[1347]: AttributeError: 'NoneType' object has no attribute 'name'

At first glance seems like an easy fix, I'll poke around a bit and see what I can do while I have time this morning.

mvcircelli commented 3 years ago

Attempted to fix by changing line 55 print to f'Stockbot is connected to \n'

Though I still get

Sep 24 15:24:45 ptnbots stockbot[1479]: _ClientEventTask exception was never retrieved
Sep 24 15:24:45 ptnbots stockbot[1479]: future: <ClientEventTask state=finished event=on_ready coro=<function on_ready at 0x7f54f482f598> 
Sep 24 15:24:45 ptnbots stockbot[1479]: Traceback (most recent call last):
Sep 24 15:24:45 ptnbots stockbot[1479]:   File "/usr/local/lib/python3.7/dist-packages/discord/client.py", line 348, in _run_event
Sep 24 15:24:45 ptnbots stockbot[1479]:     await self.on_error(event_name, *args, **kwargs)
Sep 24 15:24:45 ptnbots stockbot[1479]:   File "/usr/local/lib/python3.7/dist-packages/discord/client.py", line 343, in _run_event
Sep 24 15:24:45 ptnbots stockbot[1479]:     await coro(*args, **kwargs)
Sep 24 15:24:45 ptnbots stockbot[1479]:   File "/home/htcmatthewcircelli/EDStockTraderProject/bot.py", line 55, in on_ready
Sep 24 15:24:45 ptnbots stockbot[1479]:     f'Stockbot is connected to \n'
Sep 24 15:24:45 ptnbots stockbot[1479]: AttributeError: 'NoneType' object has no attribute 'name'
durzo commented 3 years ago

this was caused by an incorrect DISCORD_GUILD value in .env, and is now fixed.