Kameloso

Main class.

final
class Kameloso {}

Constructors

this
this(string[] args)

Constructor taking an args string array.

this
this()

No-param constructor used in unit tests.

Members

Aliases

initPluginResources
alias initPluginResources = issuePluginCallImpl!"initResources"

Initialises all plugins' resource files.

initialisePlugins
alias initialisePlugins = issuePluginCallImpl!"initialise"

Initialises all plugins, calling any module-level .initialise functions.

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. This happens after connection has been established.

Functions

args
auto args()

Returns a const slice of the command-line arguments passed to the program.

checkPluginForUpdates
void checkPluginForUpdates(IRCPlugin plugin)

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

collectChannels
auto collectChannels()

Collects all channels from 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.

instantiatePlugins
void instantiatePlugins()

Instantiates and *minimally* initialises all plugins.

issuePluginCallImpl
void issuePluginCallImpl()

Issues a call to all plugins, where such a call is one of "initialise", "setup", "start", "initResources" or "reload". This invokes their module-level functions of the same name, where available.

propagate
void propagate(Thing thing)

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

teardown
void teardown()

Teardown plugins and connection.

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.

Throttle
struct Throttle

Aggregate of values and state needed to rate-limit outgoing messages.

TransientState
struct TransientState

Transient state variables, aggregated in a struct.

Variables

_args
string[] _args;

Command-line arguments passed to the program.

_connectionID
uint _connectionID;

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

abort
Flag!"abort"* abort;

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

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 specified 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.

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 of when 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;

Pointer to the program-wide settings global.

throttle
Throttle throttle;

Values and state needed to throttle sending messages.

transient
TransientState transient;

Transient state of this Kameloso instance.