A Dockerized IRC bot for reading news. Written in Python 3
UNLICENSE License
# Clone the repository
git clone https://github.com/AlexGustafsson/irc-news-bot
# Enter the directory
cd irc-news-bot
# Run
python3 -m bot.main --server irc.example.com
You can also run the container using Docker, like so:
# Build the image
docker build -t axgn/irc-news-bot:latest .
# Run
docker run axgn/irc-news-bot --server irc.example.com --channel "#random"
docker run axgn/irc-news-bot --server irc.example.com --channel "#random"
The image is stateless and based on Debian Buster and is roughly 964MB in size, due to the dependencies used. While running, the container usually uses 0% of the CPU and roughly 25MB of RAM. During load it uses about 0.20% CPU and while starting about 0.4% on a single core and an unchanged amount of RAM.
To prevent any unforseen events, one can therefore limit the container's resources by using the flags --cpus=0.05
and --memory=64MB
which should both leave some head room.
To see help messages send news-bot: help
in the channel where the bot lives.
Each supported commands follows the news-bot: <command> <country> <language> [parameters]
.
Supported commands are: topic
for viewing news topics such as business
, location
for viewing news for a location such as Karlskrona
and search
for searching for news using a query such as security -TikTok
.
Any contribution is welcome. If you're not able to code it yourself, perhaps someone else is - so post an issue if there's anything on your mind.
Clone the repository:
git clone https://github.com/AlexGustafsson/irc-news-bot
Setup a virtual environment and dependencies:
make setup
Write code and commit it.
Follow the conventions enforced:
make static-analysis
Test the project:
make test
Although the project is very capable, it is not built with production in mind. Therefore there might be complications when trying to use the bot for large-scale projects meant for the public. The bot was created to easily send news in IRC channels and as such it might not promote best practices nor be performant.