Kameloso

State needed for the kameloso bot, aggregated in a struct for easier passing by reference.

Constructors

this
this(string[] args)

Constructor taking an args string array.

Postblit

this(this)
this(this)

Never copy this.

Members

Aliases

initPluginResources
alias initPluginResources = issuePluginCallImpl!"initResources"

Initialises all plugins' resource files.

reloadPlugins
alias reloadPlugins = issuePluginCallImpl!"reload"

Reloads all plugins by calling any module-level reload functions.

setupPlugins
alias setupPlugins = issuePluginCallImpl!"setup"

Sets up all plugins, calling any module-level setup functions.

startPlugins
alias startPlugins = issuePluginCallImpl!"start"

Starts all plugins by calling any module-level start functions.

Functions

checkPluginForUpdates
void checkPluginForUpdates(IRCPlugin plugin)

Propagates updated bots, clients, servers and/or settings, to this, parser, and to all plugins.

connectionID
auto connectionID()

Numeric ID of the current connection, to disambiguate between multiple connections in one program run. Accessor.

generateNewConnectionID
void generateNewConnectionID()

Generates a new connection ID.

initPlugins
void initPlugins()

Resets and *minimally* initialises all plugins.

propagate
void propagate(Thing thing)

Propgates an updated struct, to this, parser, and to each plugins' IRCPluginStates, overwriting existing such.

teardownPlugins
void teardownPlugins()

Tears down all plugins, deinitialising them and having them save their settings for a clean shutdown. Calls module-level teardown functions.

throttleline
auto throttleline(Buffer buffer, Flag!"dryRun" dryRun, Flag!"sendFaster" sendFaster, Flag!"immediate" immediate)

Takes one or more lines from the passed buffer and sends them to the server.

Structs

ConnectionHistoryEntry
struct ConnectionHistoryEntry

A record of a successful connection.

Variables

abort
bool* abort;

When this is set by signal handlers, the program should exit. Other parts of the program will be monitoring it.

args
string[] args;

Command-line arguments passed to the program.

backgroundBuffer
Buffer!(OutgoingLine, No.dynamic, BufferSize.outbuffer) backgroundBuffer;

Buffer of outgoing background message strings.

bot
IRCBot bot;

IRC bot values and state.

callgrindRunning
bool callgrindRunning;

Flag to keep record of whether or not the program is run under the Callgrind profiler.

conn
Connection conn;

The Connection that houses and wraps the socket we use to connect to, write to and read from the server.

connSettings
ConnectionSettings connSettings;

Settings relating to the connection between the bot and the IRC server.

connectionHistory
ConnectionHistoryEntry[] connectionHistory;

History records of established connections this execution run.

customSettings
string[] customSettings;

Custom settings specfied at the command line with the --set parameter.

fastbuffer
Buffer!(OutgoingLine, No.dynamic, BufferSize.outbuffer) fastbuffer;

Buffer of outgoing fast message strings, used on Twitch servers.

flags
StateFlags flags;

Transient state flags of this Kameloso instance.

immediateBuffer
Buffer!(OutgoingLine, No.dynamic, BufferSize.priorityBuffer) immediateBuffer;

Buffer of outgoing message strings to be sent immediately.

invalidConfigurationEntries
string[][string] invalidConfigurationEntries;

Associative array of string arrays of unexpected configuration entries that did not belong.

missingConfigurationEntries
string[][string] missingConfigurationEntries;

Associative array of string arrays of expected configuration entries that were missing.

outbuffer
Buffer!(OutgoingLine, No.dynamic, BufferSize.outbuffer) outbuffer;

Buffer of outgoing message strings.

parser
IRCParser parser;

Parser instance.

plugins
IRCPlugin[] plugins;

A runtime array of all plugins. We iterate these when we have finished parsing an IRCEvent, and call the relevant event handlers of each.

previousWhoisTimestamps
long[string] previousWhoisTimestamps;

An associative array o fwhen a nickname was last issued a WHOIS query for, UNIX timestamps by nickname key, for hysteresis and rate-limiting.

priorityBuffer
Buffer!(OutgoingLine, No.dynamic, BufferSize.priorityBuffer) priorityBuffer;

Buffer of outgoing priority message strings.

settings
CoreSettings settings;

The root copy of the program-wide settings.

throttle
Throttle throttle;

Values and state needed to throttle sending messages.

Meta