Awareness mixins, for plugins to mix in to extend behaviour and enjoy a considerable degree of automation.
The is not a plugin by itself but contains code common to all plugins, without which they will *not* function.
The section of kameloso.plugins.common that involves mixins.
The section of kameloso.plugins.common that deals with delaying executing of Fibers and delegates to a later point in time, and registering such to await a specific type of IRCEvent.
Concrete implementation of a DeferredAction.
Abstract IRC plugin class.
Whether an annotated function should be allowed to trigger on events in only home channels or in guest ones as well.
Annotation denoting that a variable enables and disables a plugin.
The tristate results from comparing a username with the admin or whitelist/elevated/operator/staff lists.
What level of permissions is needed to trigger an event handler.
In what way the contents of a IRCEvent must start (be "prefixed") for an annotated function to be allowed to trigger.
Annotation denoting that a struct variable or struct type is to be considered as housing settings for a plugin, and should thus be serialised and saved in the configuration file.
Declaration of what order event handler function should be given with respects to other functions in the same plugin module.
Judges whether an event may be triggered, based on the event itself and the annotated Permissions of the handler in question. Implementation function.
Asserts that a parameter storage class is not ref if inFiber, and neither ref nor out if not inFiber. To be run during CTFE.
Instantiates a DeferredActionImpl in the guise of a DeferredAction with the implicit type T as payload and appends it to the passed IRCPlugin's deferredActions array.
Instantiates a DeferredActionImpl in the guise of a DeferredAction with the implicit type T as payload and appends it to the passed IRCPlugin's deferredActions array.
Construct and enqueue a function replay in the plugin's queue of such.
Decides if a sender meets a Permissions and is allowed to trigger an event handler, or if a WHOIS query is needed to be able to tell.
Judges whether an event may be triggered, based on the event itself and the annotated Permissions of the handler in question. Implementation function.
Evaluates whether or not the message in an event satisfies the PrefixPolicy specified, as fetched from a IRCEventHandler.Command or IRCEventHandler.Regex UDA.
Convenience function that returns a kameloso.plugins.common.Replay of the right type, *with* a subclass plugin reference attached.
Sanitise event, used upon UTF/Unicode exceptions.
Sanity-checks a plugin's IRCEventHandlers at compile time.
Embodies the notion of an action a plugin defers to the main thread.
Mixin that fully implements an IRCPlugin.
Annotation denoting that a variable is the basename of a configuration file or directory.
Aggregate to annotate event handler functions with, to control what they do and how they work.
An aggregate of all variables that make up the common state of plugins.
Embodies the notion of an event to be replayed, once we know more about a user (meaning after a WHOIS query response).
Annotation denoting that a variable is the basename of a resource file or directory.
Helper struct to aid in testing plugins.
import kameloso.plugins; import kameloso.plugins.common; import kameloso.plugins.common.awareness; @(IRCEventHandler() .onEvent(IRCEvent.Type.CHAN) .permissionsRequired(Permissions.anyone) .channelPolicy(ChannelPolicy.home) .addCommand( IRCEventHandler.Command() .word("foo") .policy(PrefixPolicy.prefixed) ) ) void onFoo(FooPlugin plugin, const ref IRCEvent event) { // ... } mixin UserAwareness; mixin ChannelAwareness; mixin PluginRegistration!FooPlugin; final class FooPlugin : IRCPlugin { // ... mixin IRCPluginImpl; }
Contains the definition of an IRCPlugin and its ancillaries, as well as mixins to fully implement it.
Event handlers can then be module-level functions, annotated with IRCEvent.Types.