A Discord bot to send notificaitons for Home Front Command alerts
Go to file
2024-11-06 17:20:35 +02:00
db_creation v2.2.0 RELEASE! 2023-10-20 17:26:49 +03:00
translations v2.2.5.1 2024-07-28 21:19:29 +03:00
alert_maker.py v2.2.4 2023-10-30 15:58:20 +02:00
botinfo.json Okay so we ARE on v2.2.5. 2023-12-05 19:10:22 +02:00
botinfo.py v2.2.4 2023-11-16 20:06:14 +02:00
cog_notificator.py v2.2.6: fix: more robust network failure handling 2024-11-06 17:20:23 +02:00
db_access.py v2.2.4 2023-10-29 12:55:08 +02:00
errlogging.py proper district poppery (v2.2.4) 2023-12-05 12:25:40 +02:00
LICENSE.txt Create LICENSE.txt 2023-10-31 09:01:36 +02:00
main.py v2.2.5.1 2024-07-28 21:19:29 +03:00
markdown.py HFCNotificator v2.0.0 2023-10-10 22:21:19 +03:00
README.md Update README.md 2024-09-26 18:03:11 +03:00
requirements-3_11.txt v2.2.4 preps 2023-12-05 18:56:11 +02:00
requirements.txt v2.2.4 2023-11-16 20:32:44 +02:00
setup.py Added setup file 2024-05-19 17:10:49 +03:00

Home Front Command Notificator

A bot to send Discord notifications for HFC alerts

Created by GaMeNu and yrrad8

Warning

This bot is unofficial! The public instance may experience downtimes, and there may be issue with the code. Please do not rely on it alone!

Caution

As of September 2024, the public instance of HFCNotificator is offline, as none of the project maintainers are available to maintain it. Feel free to host your own instance!

Table of Contents

What is This?

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

The bot's development began in 2023, at the start of the Simchat Torah (Iron Swords) War, and is developed by GaMeNu and yrrad8. The bot aims to be relatively fast, reliable, and available for easy hosting and forking.

Feel free to send suggestions and bug reports through our discord server, or just fork the bot and add what you want yourself!

Setup

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

Alternatively, you can /register a Direct Message / Group DM channel to receive alerts directly!

Please do note that the bot instance listed under the links section is hosted on a private machine, and may be a bit slow. It is recommended to host your own instance, if possible.

Command documentation

/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.

/about

Get some info about the bot itself

/info

Get info about the system and client

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 [search] [page]

List all valid locations

/locations registered [search] [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).

Please use the requirements files (pip install -r):

Python 3.10 and below:

(python -m) pip install -r requirements.txt

Python 3.11 and above:

(python -m) pip install -r requirements-3_11.txt

Other requirements

Local data:

.env file

Save the following to a file named ".env", and replace the angled brackets with the matching data. Do note that it has to be on the same directory as main.py.

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

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

botinfo file

In botinfo.json, change the "maintainer" value (default is "GaMeNu (@gamenu)") to your username, and maybe add contact information. This is in order to allow others to contact you about issues with your specific instance, and will be publicly available through /info.

Make sure to not write any personal/private information there!

GitHub

Official Bot Invite Link

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

HFC Website

Support Server