kameloso.plugins.poll

The Poll plugin offers the ability to hold votes/polls in a channel. Any number of choices is supported, as long as they're more than one.

Cheating by changing nicknames is warded against.

Members

Classes

PollPlugin
class PollPlugin

The Poll plugin offers the ability to hold votes/polls in a channel.

Functions

deserialisePolls
void deserialisePolls(PollPlugin plugin)

Deserialises Polls from disk.

generateEndFiber
void generateEndFiber(PollPlugin plugin, string channelName, Poll poll)

Generates a fiber that ends a poll, reporting end results and cleaning up.

generatePollFiber
void generatePollFiber(PollPlugin plugin, string channelName, Poll poll)

Implementation function for generating a poll fiber.

generateVoteReminders
void generateVoteReminders(PollPlugin plugin, string channelName, Poll poll)

Generates some vote reminder fibers.

getPollChoices
auto getPollChoices(PollPlugin plugin, string channelName, string slice)

Sifts out unique choice words from a string.

onCommandPoll
void onCommandPoll(PollPlugin plugin, IRCEvent event)

Instigates a poll or stops an ongoing one.

onSelfjoin
void onSelfjoin(PollPlugin plugin, IRCEvent event)

Registers a channel entry in IRCPluginState.channels

upon joining one.

onSelfpart
void onSelfpart(PollPlugin plugin, IRCEvent event)

De-registers a channel entry in IRCPluginState.channels

upon parting from one.

onWelcome
void onWelcome(PollPlugin plugin)

Deserialises Polls saved to disk upon successfully registering to the server, restoring any ongoing polls.

reportEndResults
void reportEndResults(PollPlugin plugin, string channelName, Poll poll)

Reports the result of a Poll, as if it just ended.

reportStatus
void reportStatus(PollPlugin plugin, string channelName, Poll poll)

Reports the status of a Poll, mid-progress.

selftest
auto selftest(PollPlugin _, Selftester s)

Performs self-tests against another bot.

serialisePolls
void serialisePolls(PollPlugin plugin)

Serialises ongoing Polls to disk.

teardown
void teardown(PollPlugin plugin)

Tears down the PollPlugin, serialising any ongoing Polls to file, so they aren't lost to the ether.

Structs

Poll
struct Poll

Embodies the notion of a channel poll.

PollSettings
struct PollSettings

All Poll plugin runtime settings aggregated.

See Also

Meta