class PrivateParlorXT::Config
- PrivateParlorXT::Config
- Reference
- Object
Overview
A container for values deserialized from the configuration file
Included Modules
- YAML::Serializable
Defined in:
private-parlor-xt/config/config.crConstructors
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
-
.parse_config : Config
Deserializes the values from the config file and returns a validated
Config
Instance Method Summary
-
#blacklist_contact : String | Nil
The contact string shown to blacklisted users
-
#cooldown_base : Int32
The base integer for which cooldown times are computed from
-
#database : String
A file path to a SQLite datbase
-
#database_history : Bool | Nil
Whether or not to use the database for persisting message history
- #default_rank : Int32
- #default_rank=(default_rank : Int32)
-
#downvote_limit_interval : Int32
Limit a user's usage of
DownvoteHandlerfor once every interval (in seconds) -
#enable_blacklist : Array(Bool)
A 2-element array, the first element enables the
BlacklistCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_delete : Array(Bool)
A 2-element array, the first element enables the
DeleteCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_demote : Array(Bool)
A 2-element array, the first element enables the
DemoteCommandand the second registers itsCommandDescriptionswith @BotFather -
#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 aCommandHandler -
#enable_help : Array(Bool)
A 2-element array, the first element enables the
HelpCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_info : Array(Bool)
A 2-element array, the first element enables the
InfoCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_karma_info : Array(Bool)
A 2-element array, the first element enables the
KarmaInfoCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_karma_sign : Array(Bool)
A 2-element array, the first element enables the
KarmaSignCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_motd : Array(Bool)
A 2-element array, the first element enables the
MotdCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_pin : Array(Bool)
A 2-element array, the first element enables the
PinCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_privacy_policy : Array(Bool)
A 2-element array, the first element enables the
PrivacyPolicyCommandand the second registers itsCommandDescriptionswith @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 -
#enable_promote : Array(Bool)
A 2-element array, the first element enables the
PromoteCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_purge : Array(Bool)
A 2-element array, the first element enables the
PurgeCommandand the second registers itsCommandDescriptionswith @BotFather -
#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 itsCommandDescriptionswith @BotFather -
#enable_remove : Array(Bool)
A 2-element array, the first element enables the
RemoveCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_reveal : Array(Bool)
A 2-element array, the first element enables the
RevealCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_sign : Array(Bool)
A 2-element array, the first element enables the
SignCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_spoiler : Array(Bool)
A 2-element array, the first element enables the
SpoilerCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_start : Array(Bool)
A 2-element array, the first element enables the
StartCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_stats : Array(Bool)
A 2-element array, the first element enables the
StatsCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_stop : Array(Bool)
A 2-element array, the first element enables the
StopCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_toggle_debug : Array(Bool)
A 2-element array, the first element enables the
ToggleDebugCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_toggle_karma : Array(Bool)
A 2-element array, the first element enables the
ToggleKarmaCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_tripcode : Array(Bool)
A 2-element array, the first element enables the
TripcodeCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_tripsign : Array(Bool)
A 2-element array, the first element enables the
TripcodeSignCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_unblacklist : Array(Bool)
A 2-element array, the first element enables the
UnblacklistCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_uncooldown : Array(Bool)
A 2-element array, the first element enables the
UncooldownCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_unpin : Array(Bool)
A 2-element array, the first element enables the
UnpinCommandand the second registers itsCommandDescriptionswith @BotFather -
#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 aCommandHandler -
#enable_users : Array(Bool)
A 2-element array, the first element enables the
UsersCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_version : Array(Bool)
A 2-element array, the first element enables the
VersionCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_warn : Array(Bool)
A 2-element array, the first element enables the
WarnCommandand the second registers itsCommandDescriptionswith @BotFather -
#enable_whitelist : Array(Bool)
A 2-element array, the first element enables the
WhitelistCommandand the second registers itsCommandDescriptionswith @BotFather -
#entities : Array(String)
An array of
Stringreferring to entity types that will be removed from all messages -
#entities=(entities : Array(String))
An array of
Stringreferring to entity types that will be removed from all messages -
#flag_signatures : Bool | Nil
Whether or not to replace tripcodes with a flag or emoji signature
-
#inactivity_limit : Int32
The limit (in days) for which a user can be inactive and still receive messages
-
#intermediary_linked_network : Hash(String, String) | String | Nil
A
Stringor hash of linked network strings deserialized from the config file that will be processed and used to set#linked_network -
#intermediate_karma_levels : Hash(Int32, String)
A hash of
Int32=>Stringmapping the start of a karma level to the name of that level, which will be processed into ranges for#karma_levels -
#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 -
#karma_economy : KarmaHandler | Nil
A
KarmaHandler, which manages what a user can post based on how much karma he has -
#karma_levels : Hash(Range(Int32, Int32), String)
A hash of
Range(Int32, Int32)=>Stringmapping a range of possibleUserkarma values to the name of the karma level that is defined by that range -
#karma_levels=(karma_levels : Hash(Range(Int32, Int32), String))
A hash of
Range(Int32, Int32)=>Stringmapping a range of possibleUserkarma values to the name of the karma level that is defined by that range -
#karma_reasons : Bool | Nil
Whether or not to allow users to attach a reason to their upvote/downvote messages
-
#linked_network : Hash(String, String)
A hash of
String=>Stringmapping the name of a chat to the chat's username -
#locale : String
The language tag for Private Parlor's language/locale
-
#log_channel : String
A Telegram ID of a channel to output bot logs to
-
#log_file : String | Nil
A file path to an optional log file
-
#log_level : Log::Severity
The level of severity for log messages
-
#media_limit_period : Int32
The duration (in hours) in which new users cannot send media
-
#media_spoilers : Bool | Nil
Whether or not to allow users to send photos, videos, or GIFs with a spoiler overlay
-
#message_effects : Bool | Nil
Whether or not to allow users to attach a message effect to their messages
-
#message_lifespan : Int32
The amount of time a message can exist before expiring and being deleted from the cache
-
#message_lifespan=(message_lifespan : Int32)
The amount of time a message can exist before expiring and being deleted from the cache
-
#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
-
#r9k_cooldown : Int32
Cooldown length (in seconds) for when a user sends an unoriginal message
-
#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
-
#ranks : Hash(Int32, Rank)
A mapping of
Rankrecognized by the bot -
#ranks=(ranks : Hash(Int32, Rank))
A mapping of
Rankrecognized by the bot -
#registration_open : Bool | Nil
Whether or not registration is open, allowing new users to join
-
#regular_forwards : Bool | Nil
Whether or not to relay forwarded messages as though a
PhotoHandler,TextHandler, or similarUpdateHandlergot them -
#relay_animation : Bool | Nil
Whether or not to relay animations/GIFs and enable the
AnimationHandler -
#relay_audio : Bool | Nil
Whether or not to relay audio messages and enable the
AudioHandler -
#relay_contact : Bool | Nil
Whether or not to relay contacts and enable the
ContactHandler -
#relay_document : Bool | Nil
Whether or not to relay documents and files and enable the
DocumentHandler -
#relay_forwarded_message : Bool | Nil
Whether or not to relay forwarded messages and enable the
ForwardHandler -
#relay_location : Bool | Nil
Whether or not to relay location messages and enable the
LocationHandler -
#relay_media_group : Bool | Nil
Whether or not to relay albums and enable the
AlbumHandler -
#relay_photo : Bool | Nil
Whether or not to relay photos and enable the
PhotoHandler -
#relay_poll : Bool | Nil
Whether or not to relay polls and enable the
PollHandler -
#relay_sticker : Bool | Nil
Whether or not to relay stickers and enable the
StickerHandler -
#relay_text : Bool | Nil
Whether or not to relay text messages and enable the
TextHandler -
#relay_venue : Bool | Nil
Whether or not to relay venues and enable the
VenueHandler -
#relay_video : Bool | Nil
Whether or not to relay videos and enable the
VideoHandler -
#relay_video_note : Bool | Nil
Whether or not to relay video note messages and enable the
VideoNoteHandler -
#relay_voice : Bool | Nil
Whether or not to relay voice messages and enable the
VoiceHandler -
#salt : String
A
Stringused to generate secure tripcodes -
#sign_limit_interval : Int32
Limit a users' usage of
SignCommandandTripodeSignCommandfor once every interval (in seconds) -
#smileys : Array(String)
An array of emoticons shown in
InfoCommandmessages that start out happy and get sadder based on the number of user warnings -
#smileys=(smileys : Array(String))
An array of emoticons shown in
InfoCommandmessages that start out happy and get sadder based on the number of user warnings -
#spam_handler : SpamHandler
A
SpamHandler, which manages how much a user can post within a duration of time -
#spam_interval : Int32
The amount of time (in seconds) between spam score reductions
-
#statistics : Bool | Nil
Whether or not to enable the recording of message statistics to be viewed later using the
StatsCommand -
#toggle_r9k_forwards : Bool | Nil
Toggle ROBOT9000 for forwards; checks the text and media for forwards if both/either
#toggle_r9k_textand/or#toggle_r9k_mediaare enabled -
#toggle_r9k_media : Bool | Nil
Toggle ROBOT9000 for media
-
#toggle_r9k_text : Bool | Nil
Toggle ROBOT9000 for text and captions
-
#token : String
The API token obtained from @BotFather
-
#upvote_limit_interval : Int32
Limit a user's usage of
UpvoteHandlerfor once every interval (in seconds) -
#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. -
#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. -
#warn_deduction : Int32
The amount of karma to remove from a user when receiving a cooldown
-
#warn_lifespan : Int32
The length of time (in hours) until a warning expires
Constructor Detail
Deserializes the values from the config file and returns a validated Config
Instance Method Detail
Whether or not to use the database for persisting message history
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
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
Limit a user's usage of DownvoteHandler for once every interval (in seconds)
A 2-element array, the first element enables the BlacklistCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the DeleteCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the DemoteCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the DownvoteHandler, the second does nothing for now as this command is not a CommandHandler
A 2-element array, the first element enables the HelpCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the InfoCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the KarmaInfoCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the KarmaSignCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the MotdCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the PinCommand and the second registers its CommandDescriptions with @BotFather
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
A 2-element array, the first element enables the PromoteCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the PurgeCommand and the second registers its CommandDescriptions with @BotFather
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
A 2-element array, the first element enables the RemoveCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the RevealCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the SignCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the SpoilerCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the StartCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the StatsCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the StopCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the ToggleDebugCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the ToggleKarmaCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the TripcodeCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the TripcodeSignCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the UnblacklistCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the UncooldownCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the UnpinCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the UpvoteHandler, the second does nothing for now as this command is not a CommandHandler
A 2-element array, the first element enables the UsersCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the VersionCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the WarnCommand and the second registers its CommandDescriptions with @BotFather
A 2-element array, the first element enables the WhitelistCommand and the second registers its CommandDescriptions with @BotFather
An array of String referring to entity types that will be removed from all messages
An array of String referring to entity types that will be removed from all messages
Whether or not to replace tripcodes with a flag or emoji signature
The limit (in days) for which a user can be inactive and still receive messages
A String or hash of linked network strings deserialized from the config file that will be processed and used to set #linked_network
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
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
A KarmaHandler, which manages what a user can post based on how much karma he has
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
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
Whether or not to allow users to attach a reason to their upvote/downvote messages
A hash of String => String mapping the name of a chat to the chat's username
Whether or not to allow users to send photos, videos, or GIFs with a spoiler overlay
Whether or not to allow users to attach a message effect to their messages
The amount of time a message can exist before expiring and being deleted from the cache
The amount of time a message can exist before expiring and being deleted from the cache
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
Whether or not to give the user a warning for sending an unoriginal message and cooldown according to the number of warnings
Whether or not registration is open, allowing new users to join
Whether or not to relay forwarded messages as though a PhotoHandler, TextHandler, or similar UpdateHandler got them
Whether or not to relay animations/GIFs and enable the AnimationHandler
Whether or not to relay documents and files and enable the DocumentHandler
Whether or not to relay forwarded messages and enable the ForwardHandler
Whether or not to relay location messages and enable the LocationHandler
Whether or not to relay video note messages and enable the VideoNoteHandler
Limit a users' usage of SignCommand and TripodeSignCommand for once every interval (in seconds)
An array of emoticons shown in InfoCommand messages that start out happy and get sadder based on the number of user warnings
An array of emoticons shown in InfoCommand messages that start out happy and get sadder based on the number of user warnings
A SpamHandler, which manages how much a user can post within a duration of time
Whether or not to enable the recording of message statistics to be viewed later using the StatsCommand
Toggle ROBOT9000 for forwards; checks the text and media for forwards if both/either #toggle_r9k_text and/or #toggle_r9k_media are enabled
Limit a user's usage of UpvoteHandler for once every interval (in seconds)
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
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