module

PrivateParlorXT

Constants

VERSION = "1.2.4"

Class methods

command_disabled(message : Tourmaline::Message, services : Services) : Nil

Queues a command_disabled system reply when the CommandHandler was disabled

Source
generate_callback_query_handlers(config : Config, services : Services) : Array(Tourmaline::CallbackQueryHandler)

Initializes all CallbackHandler

Source
generate_command_handlers(config : Config, client : Tourmaline::Client, services : Services) : Array(Tourmaline::CommandHandler)

Intialize all command handlers that inherit from CommandHandler and are annotated with RespondsTo

Source
generate_hears_handlers(config : Config, services : Services) : Array(Tourmaline::HearsHandler)

Intialize all "hears" handlers that inherit from HearsHandler and are annotated with Hears

Source
generate_update_handlers(config : Config, client : Client, services : Services) : Nil

Intialize all update handlers that inherit from UpdateHandler and are annotated with On

Source
initialize_bot(client : Client | Nil = nil) : Services

Reads from the config file and initialize Services, recurring tasks, and bot handlers

Returns the initialized Services object

Source
initialize_handlers(client : Tourmaline::Client, config : Config, services : Services) : Nil

Initialize bot handlers, such as CommandHandler, HearsHandler, CallbackHandler, and UpdateHandler

Source
kick_inactive_users(limit : Time::Span, services : Services) : Nil

Force-leave users whose last active time is creater than the given Time::Span limit

Source
media_disabled(message : Tourmaline::Message, type : Tourmaline::UpdateAction, services : Services) : Nil

Queues a media_disabled system reply when the UpdateHandler was disabled

Source
start_tasks(config : Config, services : Services) : Nil

Initializes recurring tasks, such as:

  • Warning expiration
  • Message expiration (if toggled)
  • Spam cooldown expiration (if toggled)
  • Inactive user kicking (if toggled)
Source
terminate_program(routine : Tasker::Task, services : Services) : Nil

Stop the message sending routine, send remaining messages in the queue and terminate the program

Source
valid_message(ctx : Tourmaline::Context) : Tourmaline::Message | Nil

Checks if the given Tourmaline::Context contains a valid and accesible message If so, returns the Tourmaline::Message contained in the handler context Returns nil otherwise

Source

Macros

append_command_handler(command, call)

Appends given CommandHandler to Tourmaline::CommandHandler array

The given CommandHandler will respond to command value(s) of RespondsTo

Source
append_hears_handler(hears_handler, hears)

Appends given HearsHandler to Tourmaline::HearsHandler array

The given HearsHandler will respond to the pattern value of Hears

Source
create_command_handlers

Iterate through all CommandHandler subclasses and initialize Tourmaline::CommandHandler procs for these commands.

CommandDescriptions for each CommandHandler will be registered by the bot if the the command is configurable.

Source
create_hears_handlers

Iterate through all HearsHandler subclasses and initialize Tourmaline::HearsHandler procs for these handlers.

Source
create_update_handlers

Iterate through all UpdateHandler subclasses and initialize Tourmaline::UpdateHandler procs for these handlers.

Source
register_update_handler(update, on)

Registers the given UpdateHandler with the bot

The given UpdateHandler will respond to messages of type update value of On

Source

Nested types