Unit test plugin settings.
Flag denoting that MessagingProxy has been mixed in.
Sends a channel message.
Replies to a channel message.
Sends a private query message to a user.
Sends either a channel message or a private query message depending on the arguments passed to it.
Sends an ACTION "emote" to the supplied target (nickname or channel).
Sets a channel mode.
Sets the topic of a channel.
Invites a user to a channel.
Joins a channel.
Kicks a user from a channel.
Leaves a channel.
Disconnects from the server, optionally with a quit reason.
Queries the server for WHOIS information about a user.
Sends text to the server, verbatim.
Sends raw text to the server, verbatim, bypassing all queues and throttling delays.
Merely an alias to immediate, because we use both terms at different places.
Flag denoting that IRCPluginImpl has been mixed in.
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.
Judges whether an event may be triggered, based on the event itself and the annotated required Permissions of the handler in question. Wrapper function that merely calls kameloso.plugins.common.allowImpl. The point behind it is to make something that can be overridden and still allow it to call the original logic (below).
Forwards the supplied IRCEvent to IRCPluginImpl.onEventImpl.
Pass on the supplied IRCEvent to module-level functions annotated with an IRCEventHandler, registered with the matching IRCEvent.Types.
Basic constructor for a plugin.
Lets a plugin modify an IRCEvent while it's begin constructed, before it's finalised and passed on to be handled.
Writes plugin resources to disk, creating them if they don't exist.
Loads configuration for this plugin from disk.
Change a plugin's Settings-annotated settings struct member by their string name.
Prints the plugin's Settings-annotated settings struct.
Gathers the configuration text the plugin wants to contribute to the configuration file.
Tick function. Called once every main loop iteration.
Self-test function.
Returns the name of the plugin. (Technically it's the name of the module.)
Compile a list of our a plugin's oneliner commands.
Forwards to IRCPluginImpl.commandsImpl.
Collects all IRCEventHandler.Command command words and IRCEventHandler.Regex regex expressions that this plugin offers at compile time, then at runtime returns them alongside their descriptions and their visibility, as an associative array of IRCPlugin.CommandMetadatas keyed by command name strings.
Proxies a bus message to the plugin, to let it handle it (or not).
Metadata about a IRCEventHandler.Command- and/or IRCEventHandler.Regex-annotated event handler.
An IRCPluginState instance containing variables and arrays that represent the current state of the plugin. Should generally be passed by reference.
Allows a plugin to modify an event post-parsing.
Called to let the plugin react to a new event, parsed from the server.
Called when the plugin is requested to initialise its disk resources.
Reads serialised configuration text into the plugin's settings struct.
Called to let the plugin contribute settings when writing the configuration file.
Called when we want to change a setting by its string name.
Called at program start but before connection has been established.
Called when we want a plugin to print its Settings-annotated struct of settings.
Called during shutdown of a connection; a plugin's would-be destructor.
Returns the name of the plugin.
Returns an array of the descriptions of the commands a plugin offers.
Returns an array of the descriptions of the channel-specific commands a plugin offers.
Reloads the plugin, where such is applicable.
Called when a bus message arrives from another plugin.
Returns whether or not the plugin is enabled in its settings.
Called on each iteration of the main loop.
Called when the plugin is first loaded.
Performs self-tests against another bot.
import std.conv : to; import std.path : buildNormalizedPath; IRCPluginState state; state.settings.configDirectory = "conf"; state.settings.resourceDirectory = "res"; auto plugin = new UnittestPlugin(state); assert((plugin.name == "unittest_"), plugin.name); assert(!plugin.isEnabled); plugin.unittestSettings.enabled = true; assert(plugin.isEnabled); assert((plugin.Introspection.allEventHandlerUDAsInModule.length > 2), plugin.Introspection.allEventHandlerUDAsInModule.length.to!string); assert((plugin.Introspection.allEventHandlerFunctionsInModule.length > 2), plugin.Introspection.allEventHandlerFunctionsInModule.length.to!string); immutable resPathWithout = buildNormalizedPath( plugin.state.settings.resourceDirectory, "unittest.delme"); immutable resPathWith = buildNormalizedPath( plugin.state.settings.resourceDirectory, "unittest", "unittest.delme"); assert((plugin.resFileWithoutSubdir == resPathWithout), plugin.resFileWithoutSubdir); assert((plugin.resFileWithSubdir == resPathWith), plugin.resFileWithSubdir); immutable confPathWithout = buildNormalizedPath( plugin.state.settings.configDirectory, "unittest.delme"); immutable confPathWith = buildNormalizedPath( plugin.state.settings.configDirectory, "unittest", "unittest.delme"); assert((plugin.confFileWithoutSubdir == confPathWithout), plugin.confFileWithoutSubdir); assert((plugin.confFileWithSubdir == confPathWith), plugin.confFileWithSubdir);
Unit test plugin.