class

PrivateParlorXT::Config

Inherits YAML::Serializable < Reference < Object

A container for values deserialized from the configuration file

Constructors

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source
parse_config

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

Source

Instance methods

blacklist_contact

The contact string shown to blacklisted users

Source
cooldown_base

The base integer for which cooldown times are computed from

Source
database

A file path to a SQLite datbase

Source
database_history

Whether or not to use the database for persisting message history

Source
default_rank

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

Source
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

Source
downvote_limit_interval

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

Source
enable_blacklist

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

Source
enable_delete

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

Source
enable_demote

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

Source
enable_downvote

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

Source
enable_help

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

Source
enable_info

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

Source
enable_karma_info

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

Source
enable_karma_sign

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

Source
enable_motd

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

Source
enable_pin

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

Source
enable_privacy_policy

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

Source
enable_promote

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

Source
enable_purge

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

Source
enable_ranksay

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

Source
enable_remove

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

Source
enable_reveal

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

Source
enable_sign

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

Source
enable_spoiler

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

Source
enable_start

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

Source
enable_stats

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

Source
enable_stop

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

Source
enable_toggle_debug

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

Source
enable_toggle_karma

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

Source
enable_tripcode

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

Source
enable_tripsign

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

Source
enable_unblacklist

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

Source
enable_uncooldown

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

Source
enable_unpin

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

Source
enable_upvote

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

Source
enable_users

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

Source
enable_version

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

Source
enable_warn

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

Source
enable_whitelist

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

Source
entities

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

Source
entities=(entities : Array(String))

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

Source
flag_signatures

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

Source
inactivity_limit

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

Source
intermediary_linked_network

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

Source
intermediate_karma_levels

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

Source
intermediate_valid_codepoints

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

Source
karma_economy

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

Source
karma_levels

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

Source
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

Source
karma_reasons

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

Source
linked_network

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

Source
locale

The language tag for Private Parlor's language/locale

Source
log_channel

A Telegram ID of a channel to output bot logs to

Source
log_file

A file path to an optional log file

Source
log_level

The level of severity for log messages

Source
media_limit_period

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

Source
media_spoilers

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

Source
message_effects

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

Source
message_lifespan

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

Source
message_lifespan=(message_lifespan : Int32)

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

Source
pseudonymous

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

Source
r9k_cooldown

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

Source
r9k_warn

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

Source
ranks

A mapping of Rank recognized by the bot

Source
ranks=(ranks : Hash(Int32, Rank))

A mapping of Rank recognized by the bot

Source
registration_open

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

Source
regular_forwards

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

Source
relay_animation

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

Source
relay_audio

Whether or not to relay audio messages and enable the AudioHandler

Source
relay_contact

Whether or not to relay contacts and enable the ContactHandler

Source
relay_document

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

Source
relay_forwarded_message

Whether or not to relay forwarded messages and enable the ForwardHandler

Source
relay_location

Whether or not to relay location messages and enable the LocationHandler

Source
relay_media_group

Whether or not to relay albums and enable the AlbumHandler

Source
relay_photo

Whether or not to relay photos and enable the PhotoHandler

Source
relay_poll

Whether or not to relay polls and enable the PollHandler

Source
relay_sticker

Whether or not to relay stickers and enable the StickerHandler

Source
relay_text

Whether or not to relay text messages and enable the TextHandler

Source
relay_venue

Whether or not to relay venues and enable the VenueHandler

Source
relay_video

Whether or not to relay videos and enable the VideoHandler

Source
relay_video_note

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

Source
relay_voice

Whether or not to relay voice messages and enable the VoiceHandler

Source
salt

A String used to generate secure tripcodes

Source
sign_limit_interval

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

Source
smileys

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

Source
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

Source
spam_handler

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

Source
spam_interval

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

Source
statistics

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

Source
toggle_r9k_forwards

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

Source
toggle_r9k_media

Toggle ROBOT9000 for media

Source
toggle_r9k_text

Toggle ROBOT9000 for text and captions

Source
token

The API token obtained from @BotFather

Source
upvote_limit_interval

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

Source
valid_codepoints

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

Source
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

Source
warn_deduction

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

Source
warn_lifespan

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

Source