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.

Constructors

this
this(Configuration conf, HelpCommand help = HelpCommand.categorical, string file = __FILE__, size_t line = __LINE__)
this(Configuration conf, IrcEventLoop eventLoop, HelpCommand help = HelpCommand.categorical, string file = __FILE__, size_t line = __LINE__)

Create a new bot with the given configuration.

Members

Functions

addAdmins
void addAdmins(Range admins)
void addAdmins(in Admin[] admins...)

Give bot administrator rights to all the users in admins.

clients
auto clients()

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

commandPrefix
string commandPrefix()
void commandPrefix(string newPrefix)

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

commandSets
auto commandSets()

InputRange of all command sets ($(DPREF command, ICommandSet)) registered with the bot.

connect
IrcClient connect(string url, in char[] serverPassword)
IrcClient connect(string url)

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

eventLoop
IrcEventLoop eventLoop()

The event loop handling connections for this bot.

nickName
void nickName(in char[] newNick)
void nickName(string newNick)

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

realName
string realName()

The real name of this bot.

registerCommands
void registerCommands(ICommandSet cmdSet)

Register a command set with the bot.

run
void run()

Convenience method to start an event loop for a bot.

userName
string userName()

The username of this bot.

Structs

Admin
struct Admin

Represents a bot administrator.

Configuration
struct Configuration

Bot configuration.

Variables

allowPMCommands
bool allowPMCommands;

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

Meta