https://github.com/benmezger/irc-bot
An easy to extend personal IRC bot
https://github.com/benmezger/irc-bot
bot irc irc-bot python
Last synced: over 1 year ago
JSON representation
An easy to extend personal IRC bot
- Host: GitHub
- URL: https://github.com/benmezger/irc-bot
- Owner: benmezger
- License: mit
- Created: 2021-03-21T16:13:58.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-01-29T22:46:47.000Z (over 2 years ago)
- Last Synced: 2025-01-21T12:08:07.657Z (over 1 year ago)
- Topics: bot, irc, irc-bot, python
- Language: Python
- Homepage:
- Size: 534 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Personal IRC bot
## About The Project
A simple IRC bot which allows easily integrating new commands. See the Extending
for information on how to add new plugins.

### Built With
- [Python](https://python.org)
- [Python IRC](https://github.com/jaraco/irc)
## Getting Started
### Prerequisites
- Docker
- Docker-compose
### Installation
1. Run `docker-compose up`
## Usage
Create a `.env` file (see `.env.example`) with the required environment or
change the environments in `docker-compose.yaml`.
## Extending
New commands may be added by creating a new command file in `src/modules`, and
implementing the following class:
```python
from core.plugins import Plugin, register_plugin
@register_plugin(
name="weather", description="check the weather", arguments="amsterdam paris ..."
)
class CommandName(Plugin):
async def __call__(self, msg: Sequence[str]) -> str:
...
```
This will create a new command on the name of `weather`. The command supports
multiple cities to be queried. For example, user X sends `commandname arg1 arg2`,
thus msg will be `[arg1, arg2]`.
## TODOs
- Add test cases. This started as one simple `main.py`, so I didn't care much on
testing.
- Add more usable plugins
## License
Distributed under the MIT License. See `LICENSE` for more information.