class PrivateParlorXT::Config

Overview

A container for values deserialized from the configuration file

Included Modules

Defined in:

private-parlor-xt/config/config.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.parse_config : Config #

Deserializes the values from the config file and returns a validated Config


[View source]

Instance Method Detail

def blacklist_contact : String | Nil #

The contact string shown to blacklisted users


[View source]
def cooldown_base : Int32 #

The base integer for which cooldown times are computed from


[View source]
def database : String #

A file path to a SQLite datbase


[View source]
def database_history : Bool | Nil #

Whether or not to use the database for persisting message history


[View source]
def default_rank : Int32 #

The value of the Rank a user will be set to when joining for the first time, getting demoted, or when one of the #ranks are invalid


[View source]
def default_rank=(default_rank : Int32) #

The value of the Rank a user will be set to when joining for the first time, getting demoted, or when one of the #ranks are invalid


[View source]
def downvote_limit_interval : Int32 #

Limit a user's usage of DownvoteHandler for once every interval (in seconds)


[View source]
def enable_blacklist : Array(Bool) #

A 2-element array, the first element enables the BlacklistCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_delete : Array(Bool) #

A 2-element array, the first element enables the DeleteCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_demote : Array(Bool) #

A 2-element array, the first element enables the DemoteCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_downvote : Array(Bool) #

A 2-element array, the first element enables the DownvoteHandler, the second does nothing for now as this command is not a CommandHandler


[View source]
def enable_help : Array(Bool) #

A 2-element array, the first element enables the HelpCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_info : Array(Bool) #

A 2-element array, the first element enables the InfoCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_karma_info : Array(Bool) #

A 2-element array, the first element enables the KarmaInfoCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_karma_sign : Array(Bool) #

A 2-element array, the first element enables the KarmaSignCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_motd : Array(Bool) #

A 2-element array, the first element enables the MotdCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_pin : Array(Bool) #

A 2-element array, the first element enables the PinCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_privacy_policy : Array(Bool) #

A 2-element array, the first element enables the PrivacyPolicyCommand and the second registers its CommandDescriptions with @BotFather This field is not found in the config file by default; this command is always enabled and always registered regardless of if this field is in the configuration file


[View source]
def enable_promote : Array(Bool) #

A 2-element array, the first element enables the PromoteCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_purge : Array(Bool) #

A 2-element array, the first element enables the PurgeCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_ranksay : Array(Bool) #

A 2-element array, the first element enables the RanksayCommand (and all the generated rankname *say commands) and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_remove : Array(Bool) #

A 2-element array, the first element enables the RemoveCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_reveal : Array(Bool) #

A 2-element array, the first element enables the RevealCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_sign : Array(Bool) #

A 2-element array, the first element enables the SignCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_spoiler : Array(Bool) #

A 2-element array, the first element enables the SpoilerCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_start : Array(Bool) #

A 2-element array, the first element enables the StartCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_stats : Array(Bool) #

A 2-element array, the first element enables the StatsCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_stop : Array(Bool) #

A 2-element array, the first element enables the StopCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_toggle_debug : Array(Bool) #

A 2-element array, the first element enables the ToggleDebugCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_toggle_karma : Array(Bool) #

A 2-element array, the first element enables the ToggleKarmaCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_tripcode : Array(Bool) #

A 2-element array, the first element enables the TripcodeCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_tripsign : Array(Bool) #

A 2-element array, the first element enables the TripcodeSignCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_unblacklist : Array(Bool) #

A 2-element array, the first element enables the UnblacklistCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_uncooldown : Array(Bool) #

A 2-element array, the first element enables the UncooldownCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_unpin : Array(Bool) #

A 2-element array, the first element enables the UnpinCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_upvote : Array(Bool) #

A 2-element array, the first element enables the UpvoteHandler, the second does nothing for now as this command is not a CommandHandler


[View source]
def enable_users : Array(Bool) #

A 2-element array, the first element enables the UsersCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_version : Array(Bool) #

A 2-element array, the first element enables the VersionCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_warn : Array(Bool) #

A 2-element array, the first element enables the WarnCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def enable_whitelist : Array(Bool) #

A 2-element array, the first element enables the WhitelistCommand and the second registers its CommandDescriptions with @BotFather


[View source]
def entities : Array(String) #

An array of String referring to entity types that will be removed from all messages


[View source]
def entities=(entities : Array(String)) #

An array of String referring to entity types that will be removed from all messages


[View source]
def flag_signatures : Bool | Nil #

Whether or not to replace tripcodes with a flag or emoji signature


[View source]
def inactivity_limit : Int32 #

The limit (in days) for which a user can be inactive and still receive messages


[View source]
def intermediary_linked_network : Hash(String, String) | String | Nil #

A String or hash of linked network strings deserialized from the config file that will be processed and used to set #linked_network


[View source]
def intermediate_karma_levels : Hash(Int32, String) #

A hash of Int32 => String mapping the start of a karma level to the name of that level, which will be processed into ranges for #karma_levels


[View source]
def intermediate_valid_codepoints : Array(Array(Int32)) | Nil #

An array of, what should be, 2-element arrays containing the start and end of codepoint ranges that are valid for ROBOT9000 text checks, which will be processed into ranges for #valid_codepoints


[View source]
def karma_economy : KarmaHandler | Nil #

A KarmaHandler, which manages what a user can post based on how much karma he has


[View source]
def karma_levels : Hash(Range(Int32, Int32), String) #

A hash of Range(Int32, Int32) => String mapping a range of possible User karma values to the name of the karma level that is defined by that range


[View source]
def karma_levels=(karma_levels : Hash(Range(Int32, Int32), String)) #

A hash of Range(Int32, Int32) => String mapping a range of possible User karma values to the name of the karma level that is defined by that range


[View source]
def karma_reasons : Bool | Nil #

Whether or not to allow users to attach a reason to their upvote/downvote messages


[View source]
def linked_network : Hash(String, String) #

A hash of String => String mapping the name of a chat to the chat's username


[View source]
def locale : String #

The language tag for Private Parlor's language/locale


[View source]
def log_channel : String #

A Telegram ID of a channel to output bot logs to


[View source]
def log_file : String | Nil #

A file path to an optional log file


[View source]
def log_level : Log::Severity #

The level of severity for log messages


[View source]
def media_limit_period : Int32 #

The duration (in hours) in which new users cannot send media


[View source]
def media_spoilers : Bool | Nil #

Whether or not to allow users to send photos, videos, or GIFs with a spoiler overlay


[View source]
def message_effects : Bool | Nil #

Whether or not to allow users to attach a message effect to their messages


[View source]
def message_lifespan : Int32 #

The amount of time a message can exist before expiring and being deleted from the cache


[View source]
def message_lifespan=(message_lifespan : Int32) #

The amount of time a message can exist before expiring and being deleted from the cache


[View source]
def pseudonymous : Bool | Nil #

Whether or not to enable pseudonymous mode, which forces the use of tripcodes for all users and automatically prepends messages with the user's tripcode


[View source]
def r9k_cooldown : Int32 #

Cooldown length (in seconds) for when a user sends an unoriginal message


[View source]
def r9k_warn : Bool | Nil #

Whether or not to give the user a warning for sending an unoriginal message and cooldown according to the number of warnings


[View source]
def ranks : Hash(Int32, Rank) #

A mapping of Rank recognized by the bot


[View source]
def ranks=(ranks : Hash(Int32, Rank)) #

A mapping of Rank recognized by the bot


[View source]
def registration_open : Bool | Nil #

Whether or not registration is open, allowing new users to join


[View source]
def regular_forwards : Bool | Nil #

Whether or not to relay forwarded messages as though a PhotoHandler, TextHandler, or similar UpdateHandler got them


[View source]
def relay_animation : Bool | Nil #

Whether or not to relay animations/GIFs and enable the AnimationHandler


[View source]
def relay_audio : Bool | Nil #

Whether or not to relay audio messages and enable the AudioHandler


[View source]
def relay_contact : Bool | Nil #

Whether or not to relay contacts and enable the ContactHandler


[View source]
def relay_document : Bool | Nil #

Whether or not to relay documents and files and enable the DocumentHandler


[View source]
def relay_forwarded_message : Bool | Nil #

Whether or not to relay forwarded messages and enable the ForwardHandler


[View source]
def relay_location : Bool | Nil #

Whether or not to relay location messages and enable the LocationHandler


[View source]
def relay_media_group : Bool | Nil #

Whether or not to relay albums and enable the AlbumHandler


[View source]
def relay_photo : Bool | Nil #

Whether or not to relay photos and enable the PhotoHandler


[View source]
def relay_poll : Bool | Nil #

Whether or not to relay polls and enable the PollHandler


[View source]
def relay_sticker : Bool | Nil #

Whether or not to relay stickers and enable the StickerHandler


[View source]
def relay_text : Bool | Nil #

Whether or not to relay text messages and enable the TextHandler


[View source]
def relay_venue : Bool | Nil #

Whether or not to relay venues and enable the VenueHandler


[View source]
def relay_video : Bool | Nil #

Whether or not to relay videos and enable the VideoHandler


[View source]
def relay_video_note : Bool | Nil #

Whether or not to relay video note messages and enable the VideoNoteHandler


[View source]
def relay_voice : Bool | Nil #

Whether or not to relay voice messages and enable the VoiceHandler


[View source]
def salt : String #

A String used to generate secure tripcodes


[View source]
def sign_limit_interval : Int32 #

Limit a users' usage of SignCommand and TripodeSignCommand for once every interval (in seconds)


[View source]
def smileys : Array(String) #

An array of emoticons shown in InfoCommand messages that start out happy and get sadder based on the number of user warnings


[View source]
def smileys=(smileys : Array(String)) #

An array of emoticons shown in InfoCommand messages that start out happy and get sadder based on the number of user warnings


[View source]
def spam_handler : SpamHandler #

A SpamHandler, which manages how much a user can post within a duration of time


[View source]
def spam_interval : Int32 #

The amount of time (in seconds) between spam score reductions


[View source]
def statistics : Bool | Nil #

Whether or not to enable the recording of message statistics to be viewed later using the StatsCommand


[View source]
def toggle_r9k_forwards : Bool | Nil #

Toggle ROBOT9000 for forwards; checks the text and media for forwards if both/either #toggle_r9k_text and/or #toggle_r9k_media are enabled


[View source]
def toggle_r9k_media : Bool | Nil #

Toggle ROBOT9000 for media


[View source]
def toggle_r9k_text : Bool | Nil #

Toggle ROBOT9000 for text and captions


[View source]
def token : String #

The API token obtained from @BotFather


[View source]
def upvote_limit_interval : Int32 #

Limit a user's usage of UpvoteHandler for once every interval (in seconds)


[View source]
def valid_codepoints : Array(Range(Int32, Int32)) #

An array of Range(Int32, Int32) containing valid codepoints for ROBOT9000 text checks; characters in text that lie outside these ranges will signal that the text is invalid. Defaults to the ASCII character range


[View source]
def valid_codepoints=(valid_codepoints : Array(Range(Int32, Int32))) #

An array of Range(Int32, Int32) containing valid codepoints for ROBOT9000 text checks; characters in text that lie outside these ranges will signal that the text is invalid. Defaults to the ASCII character range


[View source]
def warn_deduction : Int32 #

The amount of karma to remove from a user when receiving a cooldown


[View source]
def warn_lifespan : Int32 #

The length of time (in hours) until a warning expires


[View source]