Diggler



class  Bot;

IRC bot.

A single bot can be connected to multiple networks. The bot's username and real name are shared across all networks, but the nick name can differ.


struct  Configuration;

Bot configuration.


string  nickName;

All fields are required.


string  userName;

All fields are required.


string  realName;

All fields are required.


string  commandPrefix;

All fields are required.


this(Configuration conf, string file = __FILE__, size_t line = __LINE__);
this(Configuration conf, IrcEventLoop eventLoop, string file = __FILE__, size_t line = __LINE__);

Create a new bot with the given configuration.

If eventLoop is passed, connections by this bot will be handled by the given event loop. Otherwise, the bot shares a default event loop with all other bots created in the same thread.


Boolean whether or not command invocations are allowed in private messages.


final pure nothrow @property IrcEventLoop  eventLoop();

The event loop handling connections for this bot.


final const pure nothrow @property string  commandPrefix();
final pure nothrow @property void  commandPrefix(string newPrefix);

The command prefix used to invoke bot commands through chat messages.


final pure nothrow @property string  userName();

The username of this bot.


final pure nothrow @property string  realName();

The real name of this bot.


final pure nothrow @property auto  clients();

InputRange of all networks the bot is connected to, where each network is represented by its IrcClient connection.


final pure nothrow @property auto  commandSets();

InputRange of all command sets (diggler.command.ICommandSet) registered with the bot.


final @property void  nickName(in char[] newNick);
final @property void  nickName(string newNick);

Request a new nick name for the bot on all networks.

The bot may have different nick names on different networks. Use the nick property on the clients in Bot.clients to get the current nick names.


final IrcClient  connect(string url);

Connect the bot to a network described in the IRC URL url.

The new connection is automatically added to the event loop used by this bot.

Returns
the new connection

final void  registerCommands(ICommandSet cmdSet);

Register a command set with the bot.

Parameters
ICommandSet cmdSet command set to register
See Also
diggler.command

void  addAdmins(Range)(Range accountNames) if (isInputRange!Range && is(ElementType!Range : string));
void  addAdmins()(string[] accountNames...);

Give bot administrator rights to all the users in accountNames, by account name.

The account name is the name of the account the user has registered with the network's authentication services, such as AuthServ or NickServ.

Authenticated bot administrators can run commands with the @admin command attribute.


final void  run();

Convenience method to start an event loop for a bot.

Same as executing bot.eventLoop.run().