IRC bot written in golang https://notabug.org/mouz/bot
Jim Teeuwen 34e3058c36 Refactors the `action` plugin to make it easier to add new | vor 8 Jahren | |
---|---|---|
app | vor 8 Jahren | |
irc | vor 8 Jahren | |
plugins | vor 8 Jahren | |
LICENSE | vor 8 Jahren | |
Makefile | vor 8 Jahren | |
README.md | vor 8 Jahren | |
bot.go | vor 8 Jahren | |
client.go | vor 8 Jahren | |
main.go | vor 8 Jahren | |
request.go | vor 8 Jahren |
This program is an IRC bot, specifically written for a private IRC channel.
$ go get github.com/monkeybird/autimaat
First, create a new profile directory and configuration file:
$ autimaat -new /path/to/profile
Edit the newly created configuration file to your liking:
$ nano /path/to/profile/profile.cfg
Relaunch the bot to use the new profile:
$ autimaat /path/to/profile
In order to have the bot automatically re-launch after shutdown, an external
supervisor like systemd is required. The bot will create a PID file at
/path/to/profile/app.pid
, in case the supervisor requires it.
The bot will fork itself once, after it has been launched. This is done to play nice with things like systemd. Manually forking the bot Can be done through the command:
$ kill -s USR1 `pidof autimaat`
This tells the bot to fork itself, while passing along any existing connections. The old process then shuts itself down. This mechanism allows the bot to be binary-patched, without downtime.
The weather
module provides bindings for weather related APIs.
These services require registration of accounts in order to get needed
API keys.
These keys should put in a separate weather.cfg
file, with the
following contents:
{
"WundergroundApiKey": "xxxxx"
}
The url
plugin uses the YouTube Data API v3
to fetch playback durations
for videos being linked in a channel. This API requires the registration of
a Google Developer API key at: https://console.developers.google.com/apis
The API key you receive should be assigned to the YoutubeApiKey
field in
the bot profile.
The key should put in a separate url.cfg
file, with the following contents:
{
"YoutubeApiKey": "xxxxx"
}
The bot version is made up of 3 numbers:
go install -ldflags "-X app.VersionRevision=12345"
The output of the bot to IRC channels/users is done in a specific language (duh).
Translations for all used strings can be found in the various strings.go
files,
included in all plugins, as well as the cmd
package. Basically, you should
find . -name strings.go
to get them all. Then edit them as needed.
Unless otherwise noted, the contents of this project are subject to a 1-clause BSD license. Its contents can be found in the enclosed LICENSE file.