IRCPluginImpl

Mixin that fully implements an IRCPlugin.

Uses compile-time introspection to call module-level functions to extend behaviour.

With UFCS, transparently emulates all such as being member methods of the mixing-in class.

Constructors

this
this(IRCPluginState state)

Basic constructor for a plugin.

Members

Functions

channelSpecificCommands
IRCPlugin.CommandMetadata[string] channelSpecificCommands(string channelName)

Compile a list of our a plugin's oneliner commands.

commands
IRCPlugin.CommandMetadata[string] commands()

Forwards to IRCPluginImpl.commandsImpl.

deserialiseConfigFrom
void deserialiseConfigFrom(string configFile, string[][string] missingEntries, string[][string] invalidEntries)

Loads configuration for this plugin from disk.

initResources
void initResources()

Writes plugin resources to disk, creating them if they don't exist.

isEnabled
bool isEnabled()

Introspects the current plugin, looking for a Settings-annotated struct member that has a bool annotated with Enabler, which denotes it as the bool that toggles a plugin on and off.

name
string name()

Returns the name of the plugin. (Technically it's the name of the module.)

onBusMessage
void onBusMessage(string header, Sendable content)

Proxies a bus message to the plugin, to let it handle it (or not).

onEvent
void onEvent(IRCEvent event)

Forwards the supplied IRCEvent to IRCPluginImpl.onEventImpl.

postprocess
void postprocess(IRCEvent event)

Lets a plugin modify an IRCEvent while it's begin constructed, before it's finalised and passed on to be handled.

printSettings
void printSettings()

Prints the plugin's Settings-annotated settings struct.

serialiseConfigInto
bool serialiseConfigInto(Appender!(char[]) sink)

Gathers the configuration text the plugin wants to contribute to the configuration file.

setSettingByName
bool setSettingByName(string setting, string value)

Change a plugin's Settings-annotated settings struct member by their string name.

Manifest constants

message
enum message;
Undocumented in source.
pattern
enum pattern;
Undocumented in source.

Structs

Introspection
struct Introspection

Namespace for the alias sequences of all event handler functions in this module, as well as the one of all IRCEventHandler annotations in the module.

Parameters

debug_

Enables some debug output.

module_

Name of the current module. Should never be specified and always be left to its __MODULE__ default value. Here be dragons.

Examples

final class MyPlugin : IRCPlugin
{
    MyPluginSettings myPluginSettings;  // type should be annotated @Settings at declaration

    // ...implementation...

    mixin IRCPluginImpl;
}

See Also

Meta