kameloso.plugins.quote

The Quote plugin allows for saving and replaying user quotes.

On Twitch, the commands do not take a nickname parameter; instead the owner of the channel (the broadcaster) is assumed to be the target.

Members

Classes

NoQuotesFoundException
class NoQuotesFoundException

Exception, to be thrown when there were no quotes found for a given user.

NoQuotesSearchMatchException
class NoQuotesSearchMatchException

Exception, to be thrown when given search terms failed to match any stored quotes.

QuoteIndexOutOfRangeException
class QuoteIndexOutOfRangeException

Exception, to be thrown when a given quote index was out of bounds.

QuotePlugin
class QuotePlugin

The Quote plugin provides the ability to save and replay user quotes.

Functions

getQuoteByIndexString
auto getQuoteByIndexString(Quote[] quotes, string indexString, size_t index)

Fetches a quote given an index.

getQuoteBySearchTerms
Quote getQuoteBySearchTerms(QuotePlugin plugin, Quote[] quotes, string searchTermsCased, size_t index)

Fetches a Quote whose line matches the passed search terms.

getRandomQuote
auto getRandomQuote(Quote[] quotes, string nickname, size_t index)

Fetches a random Quote from an array of such.

getTimeStringFromTimestamp
auto getTimeStringFromTimestamp(SysTime when, QuoteSettings.Precision precision)

Produces a time string from a UNIX timestamp with the provided time precision.

initResources
void initResources(QuotePlugin plugin)

Reads and writes the file of quotes to disk, ensuring that it's there.

loadQuotes
void loadQuotes(QuotePlugin plugin)

Loads quotes from disk into an associative array of Quotes.

onCommandAddQuote
void onCommandAddQuote(QuotePlugin plugin, IRCEvent event)

Adds a quote to the local storage.

onCommandDelQuote
void onCommandDelQuote(QuotePlugin plugin, IRCEvent event)

Deletes a quote, given its index in the storage.

onCommandMergeQuotes
void onCommandMergeQuotes(QuotePlugin plugin, IRCEvent event)

Merges all quotes of one user to that of another.

onCommandModQuote
void onCommandModQuote(QuotePlugin plugin, IRCEvent event)

Modifies a quote given its index in the storage.

onCommandQuote
void onCommandQuote(QuotePlugin plugin, IRCEvent event)

Replies with a quote, either fetched randomly, by search terms or by stored index.

onWelcome
void onWelcome(QuotePlugin plugin)

Initialises the passed QuotePlugin. Loads the quotes from disk.

reload
void reload(QuotePlugin plugin)

Reloads the JSON quotes from disk.

removeWeeChatHead
auto removeWeeChatHead(string line, string nickname, string prefixes)

Removes the WeeChat timestamp and nickname from the front of a string.

saveQuotes
void saveQuotes(QuotePlugin plugin)

Saves quotes to disk in JSON file format.

selftest
auto selftest(QuotePlugin _, Selftester s)

Performs self-tests against another bot.

sendQuoteToChannel
void sendQuoteToChannel(QuotePlugin plugin, Quote quote, string channelName, string nickname, size_t index)

Sends a Quote to a channel.

Structs

Quote
struct Quote

Embodies the notion of a quote. A string line paired with a UNIX timestamp.

QuoteSettings
struct QuoteSettings

All settings for a Quote plugin, gathered in a struct.

Senders
struct Senders

Functions that send common brief snippets of text to the server.

See Also

Meta