kameloso.plugins.bash

The Bash plugin looks up quotes from bash.org (or technically bashforever.com) and reports them to the appropriate nickname or channel.

Members

Classes

BashPlugin
class BashPlugin

The Bash plugin looks up quotes from bash.org (or technically bashforever.com) and reports them to the appropriate nickname or channel.

Functions

lookupQuote
void lookupQuote(BashPlugin plugin, string quoteID, IRCEvent event)

Looks up a quote from bashforever.com and sends it to the appropriate nickname or channel.

onCommandBash
void onCommandBash(BashPlugin plugin, IRCEvent event)

Fetch a random or specified bashforever.com quote.

onEndOfMotd
void onEndOfMotd(BashPlugin plugin, IRCEvent event)

Starts the persistent querier worker thread on end of MOTD.

parseResponseIntoBashLookupResult
auto parseResponseIntoBashLookupResult(Response res)

Parses the response body of a Response into a BashLookupResult.

persistentQuerier
void persistentQuerier(MutexedAA!(BashLookupResult[int]) lookupBucket, string caBundleFile)

Persistent querier worker thread function.

selftest
auto selftest(BashPlugin _, Selftester s)

Performs self-tests against another bot.

sendHTTPRequest
BashLookupResult sendHTTPRequest(BashPlugin plugin, string url, bool recursing, int id, string caller)

Issues an HTTP request by sending the details to the persistent querier thread, then returns the results after they become available in the shared associative array.

sendHTTPRequestImpl
auto sendHTTPRequestImpl(string url, string caBundleFile)

Fetches the contents of a URL, parses it into a BashLookupResult and returns it.

setup
void setup(BashPlugin plugin)

Initialises the lookup bucket, else its internal Mutex will be null and cause a segfault when trying to lock it.

teardown
void teardown(BashPlugin plugin)

Stops the persistent querier worker thread.

waitForLookupResults
auto waitForLookupResults(BashPlugin plugin, int id)

Given an int id, monitors the lookupBucket until a value with that key becomes available, delaying itself in between checks.

Structs

BashLookupResult
struct BashLookupResult

The result of a bashforever.com lookup.

BashSettings
struct BashSettings

All Bash plugin settings gathered.

See Also

Meta