autimaat

command module
v1.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2016 License: BSD-1-Clause Imports: 26 Imported by: 0

README

autimaat

This program is an IRC bot, specifically written for a private IRC channel.

Install

$ go get github.com/monkeybird/autimaat

Usage

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.

Weather plugin

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"
}

url plugin

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"
}

Versioning

The bot version is made up of 3 numbers:

  • Major version: This number only changes if the bot itself changes in a way that makes it incompatible with previous versions. This does not include modules implementing commands.
  • Minor version: This number changes whenever one of the module APIs change, or commands are added/removed.
  • Revision: This is the build number. It is a current unix timestamp, which is updated whenever the bot is recompiled. This happenes whenever any kind of change occurs in any of the code. Including bug fixes. This number is updated through a go build flag. E.g.: go install -ldflags "-X app.VersionRevision=12345"

String translations

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.

license

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app
Package app defines some utility code which may be shared between packages.
Package app defines some utility code which may be shared between packages.
logger
Package logger defines facilities to write bot data to log files, along with code which cycles log cycles and purges log files when needed.
Package logger defines facilities to write bot data to log files, along with code which cycles log cycles and purges log files when needed.
proc
Package proc provides process forking and initialization functionality for one or more IRC clients.
Package proc provides process forking and initialization functionality for one or more IRC clients.
util
Package util defines a few commonly used utility functions.
Package util defines a few commonly used utility functions.
irc
Package irc defines some utility types and functions for an IRC bot.
Package irc defines some utility types and functions for an IRC bot.
cmd
Package cmd allows the definition of command handlers to be called by users from either a channel or a private message.
Package cmd allows the definition of command handlers to be called by users from either a channel or a private message.
proto
Package proto defines convenience functions for IRC protocol requests.
Package proto defines convenience functions for IRC protocol requests.
Package plugins defines and maintains supported bot plugins.
Package plugins defines and maintains supported bot plugins.
action
Package action binds action commands.
Package action binds action commands.
admin
Package admin defines administrative bot commands.
Package admin defines administrative bot commands.
alarm
Package alarm allows a user to schedule an alarm with a custom message.
Package alarm allows a user to schedule an alarm with a custom message.
dictionary
Package dictionary provides a custom dictionary.
Package dictionary provides a custom dictionary.
stats
Package stats retains a listing of user host names, mapped to nicknames they have ever been seen using, along with some other, rudimentary user statistics.
Package stats retains a listing of user host names, mapped to nicknames they have ever been seen using, along with some other, rudimentary user statistics.
url
Package url defines a plugin, which finds and extracts URLs from incoming chat data.
Package url defines a plugin, which finds and extracts URLs from incoming chat data.
url/youtube
Package youtube provides a minimal set of bindings for Youtube's Data API v3.
Package youtube provides a minimal set of bindings for Youtube's Data API v3.
weather
Package weather provides commands to do current weather lookups, as well as weather forecasts for specific locations.
Package weather provides commands to do current weather lookups, as well as weather forecasts for specific locations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL