class PrivateParlorXT::Services

Overview

Container for all objects needed for handlers

Defined in:

private-parlor-xt/services.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(config : HandlerConfig, locale : Locale, replies : Replies, logs : Logs, descriptions : CommandDescriptions, database : Database, history : History, access : AuthorizedRanks, relay : Relay, spam : SpamHandler | Nil = nil, robot9000 : Robot9000 | Nil = nil, karma : KarmaHandler | Nil = nil, stats : Statistics | Nil = nil) #

Creates an instance of Services.

Arguments:

#config : HandlerConfig object with a limited set of configuration values to be used in subclasses of Handler and CallbackHandler

#locale : Locale, general localized values from a locale file

#replies : Replies, system message replies from a locale file

#logs : Logs, log messages from a locale file

command_descriptions : CommandDescriptions, descriptions for commands from a locale file

#database : Database object

#history : message History object

#access : AuthorizedRanks module used to ensure authorized use of commands and messages

#relay : Relay object for queueing messages and sending them to Telegram

#spam : SpamHandler object preventing message spam, if this module is toggled

#robot9000 : Robot9000 object ensure message uniqueness, if this module is toggled

#karma : KarmaHandler object that requires users to have karma in order to send messages, if this module is toggled

#stats : Statistics object that records data about the bot, if this module is toggled


[View source]
def self.new(config : Config, client : Client) #

Creates a new instance of Services from a Config file


[View source]

Instance Method Detail

def access : AuthorizedRanks #

Retrusn the AuthorizedRanks object


[View source]
def config : HandlerConfig #

Returns the HandlerConfig object


[View source]
def database : Database #

Returns the Database object


[View source]
def descriptions : CommandDescriptions #

Returns the CommandDescriptions object


[View source]
def history : History #

Retruns the History object


[View source]
def karma : KarmaHandler | Nil #

Returns the KarmaHandler object if it is available


[View source]
def locale : Locale #

Returns the Locale object


[View source]
def logs : Logs #

Returns the Logs object


[View source]
def relay : Relay #

Returns the Relay object


[View source]
def replies : Replies #

Returns the Replies object


[View source]
def robot9000 : Robot9000 | Nil #

Returns the Robot9000 object if it is available


[View source]
def spam : SpamHandler | Nil #

Returns the SpamHandler object if it is available


[View source]
def stats : Statistics | Nil #

Returns the Statistics object if it is available


[View source]