- Python 3.7+ is required to run this bot.
- Your bot added to your server (on which you are receiving the messages). Refer to here to create a discord bot.
- An email to receive notifications from.
Run: pip install -r requirements.txt
1- Add the configurations in the .env file. Here are the list of configurations and their function:
- BOT_TOKEN: Your Discord bot bot token.
- BOT_CHANNEL_ID: Discord channel ID which the bot will monitor.
- MACHINE_TIMEOUT: Time (in seconds) before which the bot will consider the machine not working if no updates from it got received on the channel.
- UPDATE_RATE: Time (in seconds) of periodic updates check (1 means the bot checks for updates every 1 second).
- RISK_MARGIN_NOTIFICATION_SECONDS: Time (in seconds) which u will not get any more risk of marging notifications after the first one received.
- EMAIL_SENDER: Notification sending email.
- EMAIL_PASSWORD: Notification Email password (or application password in case of Gmail, refer to here to create a one).
- EMAIL_RECEIVER: Receiver email to get notifications on.
- EMAIL_HOST: smtp host to send emails through (smtp.gmail.com for Gmail).
- EMAIL_PORT: smtp port (587).
2- From cmd (or terminal), run: python main.py
- Go to the Discord Developer Portal (https://discord.com/developers/applications) and sign in.
- Click on the "New Application" button to create a new bot.
- Give your bot a name and click on the "Create" button.
- It'll now take you to a page in which you can enter details such as your app's description, add tags, an app icon, and more. Once done, hit the Save Changes button to proceed
- Click on the "Bot" section on the left sidebar and then click on "Add Bot."
-
- You'll now see a security token for your bot on the next page. If the token hasn't been generated, simply tap on the Reset button to create a new token. Copy this token ID as we'll need it
- Navigate to intents section and enable all of them
- Now, look for the OAuth2 option in the menu on the left sidebar and click on it to find your CLIENT ID. It's a long string of numbers.
- Paste to this URL below -- replace the word CLIENTID with the actual CLIENT ID that you just copied -
https://discordapp.com/oauth2/authorize?&client_id=CLIENTID&scope=bot&permissions=8
- Simply paste this particular URL into your web browser and hit enter. It'll open a page in which you can tell Discord where to send your bot. Select the server to which you want to add your new bot from the dropdown menu