kameloso.plugins.counter

A simple counter plugin.

Allows you to define runtime !word counters that you can increment, decrement or assign specific values to. This can be used to track deaths in video games, for instance.

Members

Classes

CounterPlugin
class CounterPlugin

The Counter plugin allows for users to define counter commands at runtime.

Functions

formatMessage
auto formatMessage(CounterPlugin plugin, string pattern, IRCEvent event, Counter counter, long step)

Formats a message by a string pattern, replacing select keywords with more helpful values.

initResources
void initResources(CounterPlugin plugin)

Reads and writes the file of persistent counters to disk, ensuring that it's there and properly formatted.

loadCounters
void loadCounters(CounterPlugin plugin)

Loads Counters from disk.

onCommandCounter
void onCommandCounter(CounterPlugin plugin, IRCEvent event)

Manages runtime counters (adding, removing and listing).

onCounterWord
void onCounterWord(CounterPlugin plugin, IRCEvent event)

Allows users to increment, decrement, and set counters.

onWelcome
void onWelcome(CounterPlugin plugin)

Populate the counters array after we have successfully logged onto the server.

reload
void reload(CounterPlugin plugin)

Reloads counters from disk.

saveCounters
void saveCounters(CounterPlugin plugin)

Saves Counters to disk in JSON format.

selftest
auto selftest(CounterPlugin plugin, Selftester s)

Performs self-tests against another bot.

Structs

Counter
struct Counter

Embodiment of a counter. Literally just a number with some ancillary metadata.

CounterSettings
struct CounterSettings

All Counter plugin settings aggregated.

See Also

Meta