A Discord bot to send notificaitons for Home Front Command alerts
Go to file
GaMeNu 7615b9b8ce v2.2.3
Create new async task for sending out messages to not block API updates in the meantime
2023-10-25 21:49:17 +03:00
db_creation v2.2.0 RELEASE! 2023-10-20 17:26:49 +03:00
translations HFCNotificator v2.0.0 2023-10-10 22:21:19 +03:00
cog_notificator.py v2.2.3 2023-10-25 21:49:17 +03:00
db_access.py v2.2.3 2023-10-25 21:19:55 +03:00
main.py HFCNotificator v2.0.0 2023-10-10 22:21:19 +03:00
markdown.py HFCNotificator v2.0.0 2023-10-10 22:21:19 +03:00
README.md v2.2.3 2023-10-25 21:19:55 +03:00
requirements-new-python.txt Add a requirements files 2023-10-23 22:42:08 +03:00
requirements.txt Revert "change a requirement files" 2023-10-24 14:12:36 +03:00

Home Front Command Notificator

A bot to send Discord notifications for HFC alerts

Created by GaMeNu and yrrad8

IMPORTANT: This bot is unofficial! Please do not rely on it alone.

What is this?

This is a bot that connects to the HFC's servers and sends real-time notifications about alerts in Israel.

Setup

Invite the bot to a server, and /register a channel, and you're ready to go!

Alternatively, you can DM the bot to receive alerts directly to your DMs!

Please do note that the bot instance listed here is hosted on a private machine, and may be a bit slow.

Command documentation

/about

Get some info about the bot

/register

Run in a channel to register it to receive alerts

/unregister

Run in a registered channel to stop it from receiving alerts

/latest <time> <unit> [page]

Get the latest alerts from up to a certain time back.

Location commands

/locations add <id>

Register a location to receive alerts from

/locations remove <id>

Remove a location to receive alerts from

/locations clear <id>

Clear all registered locations (Get alerts from everywhere)

/locations list [page]

List all valid locations

/locations registered [page]

List all registered locations

Self-hosting

Requirements

Required PyPI packages (run each with pip install)

Note: On Windows you will have to write python -m pip instead of pip at the beginning of pip install commands

Note: as of 2023-10-23, discord.py seems to not install properly for Python 3.11 and above. The fix we've found is to first install the beta version of package aiohttp separately (aiohttp==3.9.0b0).

discord.py
mysql-connector-python
requests
python-dotenv

You can also use the requirements files (pip install -r):

Python 3.10 and below:

requirements.txt

Python 3.11 and above:

requirements-new-python.txt

Other requirements

MySQL Server: https://dev.mysql.com/downloads/mysql/

.env format:

Replace the angled brackets with the matching data

TOKEN = <Discord bot token>
AUTHOR_ID = <Your Discord user ID>

DB_USERNAME = <MySQL database username>
DB_PASSWORD = <MySQL database password>

note that the .env file must be in the same directory as main.py

GitHub

Official Bot Invite Link

Bot Profile (Use to open a Direct Message with the bot)

HFC Website

Support Server