flakas / reconbot

A tool to post EVE Online notifications to Slack or Discord

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception in esi_notification_task

GhostMB opened this issue · comments


[2018-04-30 15:26:51.103477] Exception in esi_notification_task

Traceback (most recent call last):
File "/home/reconbot/tasks.py", line 28, in esi_notification_task
notifier.notify(message)
File "/home/reconbot/notifiers/caching.py", line 14, in notify
self.notifier.notify(text, options)
File "/home/reconbot/notifiers/splitter.py", line 7, in notify
notifier.notify(text, options)
File "/home/reconbot/notifiers/discord.py", line 17, in notify
loop.run_until_complete(self._send_message(channel_id, text))
File "/usr/lib64/python3.6/asyncio/base_events.py", line 468, in run_until_complete
return future.result()
File "/home/reconbot/notifiers/discord.py", line 24, in _send_message
await self.client.send_message(c, message)
File "/home/reconbot/venv/reconbot/lib64/python3.6/site-packages/discord/client.py", line 1152, in send_message
data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts, embed=embed)
File "/home/reconbot/venv/reconbot/lib64/python3.6/site-packages/discord/http.py", line 200, in request
raise HTTPException(r, data)
discord.errors.HTTPException: BAD REQUEST (status code: 400): Unauthorized
BAD REQUEST (status code: 400): Unauthorized

Hey @GhostMB, thanks for the issue report.
Do you have a valid Discord token and channel specified?
It seems like the token is unauthorized to access.

yes

When specifying the channel_id for Discord, make sure it is a channel ID (as in numeric ID, e.g. 349619049607104640), and not the human readable channel name (e.g. #mychannel or mychannel).
Looks like getting that wrong and specifying an incorrect channel ID may be one of the reasons for a BAD REQUEST response.

To get the Discord Channel ID, please refer to this guide.

If it's not that - let me know and I may dig deeper, but so far I am failing to produce any issues with the proper configuration.

If this issue is still occurring, I would suggest switching to the Discord Webhook approach, as added in #10.