ryelogheat / xpbot

Analyze a media file, identify the TMDB/IMDB, and generate all the necessary info to upload a torrent to a private tracker using the UNIT3D codebase
56 stars 27 forks source link

Add notifications #2

Closed ryelogheat closed 3 years ago

ryelogheat commented 3 years ago

Send notifications to Slack or Discord detailing what's being uploaded, torrent title, and final upload status. As well as any errors encountered during the upload process

ryelogheat commented 3 years ago

Added basic support for discord notifications, see image below for example of what you can expect

discord_notification Note, this sends messages to a Channel in a Server not as a DM to a user

Also Discord webhook seems to have some sort of rate limiting so I've added some time.sleep() to parts of the code (Total of 2 extra seconds)

To use, generate a Webhook URL (How to generate Webhook URL) and add that URL to the DISCORD_WEBHOOK= part in your config.env file. If you don't want the notification anymore, simply remove the URL from your config.env file