module PrivateParlorXT
Defined in:
private-parlor-xt/album_helpers.crprivate-parlor-xt/client.cr
private-parlor-xt/config/config.cr
private-parlor-xt/config/handler_config.cr
private-parlor-xt/constants.cr
private-parlor-xt/database/SQLite/sqlite_database.cr
private-parlor-xt/database/SQLite/sqlite_user.cr
private-parlor-xt/database/database.cr
private-parlor-xt/format.cr
private-parlor-xt/handler.cr
private-parlor-xt/handlers/callback_query_handler.cr
private-parlor-xt/handlers/callback_query_handlers/statistics_query_handler.cr
private-parlor-xt/handlers/command_handler.cr
private-parlor-xt/handlers/command_handlers/blacklist_command.cr
private-parlor-xt/handlers/command_handlers/delete_command.cr
private-parlor-xt/handlers/command_handlers/demote_command.cr
private-parlor-xt/handlers/command_handlers/help_command.cr
private-parlor-xt/handlers/command_handlers/info_command.cr
private-parlor-xt/handlers/command_handlers/karma_info_command.cr
private-parlor-xt/handlers/command_handlers/karma_sign_command.cr
private-parlor-xt/handlers/command_handlers/motd_command.cr
private-parlor-xt/handlers/command_handlers/pin_command.cr
private-parlor-xt/handlers/command_handlers/privacy_command.cr
private-parlor-xt/handlers/command_handlers/promote_command.cr
private-parlor-xt/handlers/command_handlers/purge_command.cr
private-parlor-xt/handlers/command_handlers/ranksay_command.cr
private-parlor-xt/handlers/command_handlers/remove_command.cr
private-parlor-xt/handlers/command_handlers/reveal_command.cr
private-parlor-xt/handlers/command_handlers/sign_command.cr
private-parlor-xt/handlers/command_handlers/spoiler_command.cr
private-parlor-xt/handlers/command_handlers/start_command.cr
private-parlor-xt/handlers/command_handlers/statistics_command.cr
private-parlor-xt/handlers/command_handlers/stop_command.cr
private-parlor-xt/handlers/command_handlers/toggle_debug_command.cr
private-parlor-xt/handlers/command_handlers/toggle_karma_command.cr
private-parlor-xt/handlers/command_handlers/tripcode_command.cr
private-parlor-xt/handlers/command_handlers/tripcode_sign_command.cr
private-parlor-xt/handlers/command_handlers/unblacklist.command.cr
private-parlor-xt/handlers/command_handlers/uncooldown_command.cr
private-parlor-xt/handlers/command_handlers/unpin_command.cr
private-parlor-xt/handlers/command_handlers/users_command.cr
private-parlor-xt/handlers/command_handlers/version_command.cr
private-parlor-xt/handlers/command_handlers/warn_command.cr
private-parlor-xt/handlers/command_handlers/whitelist_command.cr
private-parlor-xt/handlers/hears_handler.cr
private-parlor-xt/handlers/hears_handlers/downvote_handler.cr
private-parlor-xt/handlers/hears_handlers/upvote_handler.cr
private-parlor-xt/handlers/update_handler.cr
private-parlor-xt/handlers/update_handlers/album_handler.cr
private-parlor-xt/handlers/update_handlers/animation_handler.cr
private-parlor-xt/handlers/update_handlers/audio_handler.cr
private-parlor-xt/handlers/update_handlers/contact_handler.cr
private-parlor-xt/handlers/update_handlers/document_handler.cr
private-parlor-xt/handlers/update_handlers/forward_handler.cr
private-parlor-xt/handlers/update_handlers/location_handler.cr
private-parlor-xt/handlers/update_handlers/photo_handler.cr
private-parlor-xt/handlers/update_handlers/poll_handler.cr
private-parlor-xt/handlers/update_handlers/regular_forward_handler.cr
private-parlor-xt/handlers/update_handlers/sticker_handler.cr
private-parlor-xt/handlers/update_handlers/text_handler.cr
private-parlor-xt/handlers/update_handlers/venue_handler.cr
private-parlor-xt/handlers/update_handlers/video_handler.cr
private-parlor-xt/handlers/update_handlers/video_note_handler.cr
private-parlor-xt/handlers/update_handlers/voice_handler.cr
private-parlor-xt/history/cached_history.cr
private-parlor-xt/history/history.cr
private-parlor-xt/history/sqlite_history.cr
private-parlor-xt/initializers.cr
private-parlor-xt/karma_economy/karma_handler.cr
private-parlor-xt/locale/command_descriptions.cr
private-parlor-xt/locale/locale.cr
private-parlor-xt/locale/localization.cr
private-parlor-xt/locale/logs.cr
private-parlor-xt/locale/replies.cr
private-parlor-xt/ranks/authorized_ranks.cr
private-parlor-xt/ranks/command_permissions.cr
private-parlor-xt/ranks/message_permissions.cr
private-parlor-xt/ranks/rank.cr
private-parlor-xt/relay/queue.cr
private-parlor-xt/relay/queued_message.cr
private-parlor-xt/relay/relay.cr
private-parlor-xt/robot9000/robot9000.cr
private-parlor-xt/robot9000/sqlite_r9k.cr
private-parlor-xt/services.cr
private-parlor-xt/spam/spam_handler.cr
private-parlor-xt/statistics/sqlite_statistics.cr
private-parlor-xt/statistics/statistics.cr
private-parlor-xt/user.cr
private_parlor_xt.cr
Constant Summary
-
VERSION =
"1.2.3"
Class Method Summary
-
.command_disabled(message : Tourmaline::Message, services : Services) : Nil
Queues a command_disabled system reply when the
CommandHandler
was disabled -
.generate_callback_query_handlers(config : Config, services : Services) : Array(Tourmaline::CallbackQueryHandler)
Initializes all
CallbackHandler
-
.generate_command_handlers(config : Config, client : Tourmaline::Client, services : Services) : Array(Tourmaline::CommandHandler)
Intialize all command handlers that inherit from
CommandHandler
and are annotated withRespondsTo
-
.generate_hears_handlers(config : Config, services : Services) : Array(Tourmaline::HearsHandler)
Intialize all "hears" handlers that inherit from
HearsHandler
and are annotated withHears
-
.generate_update_handlers(config : Config, client : Client, services : Services) : Nil
Intialize all update handlers that inherit from
UpdateHandler
and are annotated withOn
-
.initialize_bot(client : Client | Nil = nil) : Services
Reads from the config file and initialize
Services
, recurring tasks, and bot handlers -
.initialize_handlers(client : Tourmaline::Client, config : Config, services : Services) : Nil
Initialize bot handlers, such as
CommandHandler
,HearsHandler
,CallbackHandler
, andUpdateHandler
-
.kick_inactive_users(limit : Time::Span, services : Services) : Nil
Force-leave users whose last active time is creater than the given
Time::Span
limit -
.media_disabled(message : Tourmaline::Message, type : Tourmaline::UpdateAction, services : Services) : Nil
Queues a media_disabled system reply when the
UpdateHandler
was disabled -
.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)
-
.terminate_program(routine : Tasker::Task, services : Services) : Nil
Stop the message sending routine, send remaining messages in the queue and terminate the program
Macro Summary
-
append_command_handler(command, call)
Appends given
CommandHandler
toTourmaline::CommandHandler
array -
append_hears_handler(hears_handler, hears)
Appends given
HearsHandler
toTourmaline::HearsHandler
array -
create_command_handlers
Iterate through all
CommandHandler
subclasses and initializeTourmaline::CommandHandler
procs for these commands. -
create_hears_handlers
Iterate through all
HearsHandler
subclasses and initializeTourmaline::HearsHandler
procs for these handlers. -
create_update_handlers
Iterate through all
UpdateHandler
subclasses and initializeTourmaline::UpdateHandler
procs for these handlers. -
register_update_handler(update, on)
Registers the given
UpdateHandler
with the bot
Class Method Detail
Queues a command_disabled system reply when the CommandHandler
was disabled
Initializes all CallbackHandler
Intialize all command handlers that inherit from CommandHandler
and are annotated with RespondsTo
Intialize all "hears" handlers that inherit from HearsHandler
and are annotated with Hears
Intialize all update handlers that inherit from UpdateHandler
and are annotated with On
Reads from the config file and initialize Services
, recurring tasks, and bot handlers
Returns the initialized Services
object
Initialize bot handlers, such as CommandHandler
, HearsHandler
, CallbackHandler
, and UpdateHandler
Force-leave users whose last active time is creater than the given Time::Span
limit
Queues a media_disabled system reply when the UpdateHandler
was disabled
Initializes recurring tasks, such as:
- Warning expiration
- Message expiration (if toggled)
- Spam cooldown expiration (if toggled)
- Inactive user kicking (if toggled)
Stop the message sending routine, send remaining messages in the queue and terminate the program
Macro Detail
Appends given CommandHandler
to Tourmaline::CommandHandler
array
The given CommandHandler
will respond to command value(s) of RespondsTo
Appends given HearsHandler
to Tourmaline::HearsHandler
array
The given HearsHandler
will respond to the pattern value of Hears
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.
Iterate through all HearsHandler
subclasses and initialize Tourmaline::HearsHandler
procs for these handlers.
Iterate through all UpdateHandler
subclasses and initialize Tourmaline::UpdateHandler
procs for these handlers.
Registers the given UpdateHandler
with the bot
The given UpdateHandler
will respond to messages of type update value of On