An open API service indexing awesome lists of open source software.

https://github.com/preaction/bot-freyr

An IRC bot with multi-network capabilities and a web API
https://github.com/preaction/bot-freyr

Last synced: about 1 year ago
JSON representation

An IRC bot with multi-network capabilities and a web API

Awesome Lists containing this project

README

          

NAME
Freyr - IRC bot with multi-network and web API

VERSION
version 0.001

SYNOPSIS
use Freyr;
use Freyr::Plugin::Say;

my $bot = Freyr->new(
host => 'irc.perl.org',
channels => [ '#freyr' ],
nick => 'freyr',
prefix => '!',
plugins => {
say => Freyr::Plugin::Say->new,
},
);
$bot->start;

# In #freyr on irc.perl.org...
# -- Message addressed to the bot
# > freyr, say I'm a little teapot
# freyr> I'm a little teapot
# -- "prefix" message
# > !say Short and stout
# freyr> Short and stout

DESCRIPTION
Freyr is an IRC bot designed for multiple networks and a web interface.

ATTRIBUTES
nick
The default nickname for the bot

prefix
The prefix character. A shortcut to address the bot.

host
The default host to connect to in single-network mode.

port
The default port to connect to in single-network mode.

network
The network the bot is currently connected to.

channels
The channel names to connect to in single-network mode.

plugins
The plugins to attach to this bot, keyed by route. The plugin will be
registered with the given route.

log
The Mojo::Log object attached to this bot

ioloop
The Mojo::IOLoop the bot should use.

_route
The Freyr::Route for the entire bot.

METHODS
BUILD
Initialize the network in single-network mode.

channel( NAME )
Get a channel object, joining the channel if necessary.

route( ROUTE => DEST )
Add a route to the entire bot. Routes must be unique. Only one route
will be triggered for every message.

_route_message( NETWORK, MESSAGE )
AUTHOR
Doug Bell

COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Doug Bell.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.