Open ppfeufer opened 1 year ago
Happy to take thoughts on how the logging can be extended. It is currently pretty loud.
Processing tasks from queue to happens here: https://github.com/Solar-Helix-Independent-Transport/allianceauth-discordbot/blob/master/aadiscordbot/bot.py#L185-L217
Running of tasks happens here: https://github.com/Solar-Helix-Independent-Transport/allianceauth-discordbot/blob/master/aadiscordbot/bot_tasks.py#L33-L37
The tasks the bot actually runs are defined round here: https://github.com/Solar-Helix-Independent-Transport/allianceauth-discordbot/blob/master/aadiscordbot/bot_tasks.py#L43 https://github.com/Solar-Helix-Independent-Transport/allianceauth-discordbot/blob/master/aadiscordbot/bot_tasks.py#L68
I meant exceptions we as dev can catch in our apps when using the discordbot-tasks.
For issues like this:
To allow us to do something like this:
try:
aadiscordbot.tasks.send_channel_message_by_discord_id.delay(
rss_feed.discord_channel.channel,
discord_message,
embed=False,
)
except DiscordbotException as ex:
logger.debug(f"Something went wrong. {ex.message}")
This can't be done with the current way we run tasks. The tasks you call in auth are simple shims. So the bot can manage it's rate limits 100% separately to auth.
I can, and will add more logging tho.
Add exceptions with error messages to the API functions like
send_channel_message_by_discord_id
,send_direct_message_by_discord_id
andsend_direct_message_by_user_id
so app devs can implement proper error handling when calling these tasks.Thank you!