class

PrivateParlorXT::Statistics

Inherits Reference < Object

A base class statistics module used for calculating and recording data about messages and users

Instance methods

config_screen(services : Services) : String

Returns a formatted String containing information about the bot and its toggles

Source
configuration_details(services : Services) : Hash(BotInfo, String)

Returns a hash of BotInfo to String, containing information about configuration data and toggles

Source
full_users_screen(services : Services) : String

Returns a formatted String containing user counts

Source
increment_downvotes

Increment the number of downvotes given

Source
increment_messages(type : Messages) : Nil

Increment the message count according to the given type and increment the total number of messages in general

Source
increment_unoriginal_media

Increment the number of unoriginal media messages encountered

Source
increment_unoriginal_text

Increment the number of unoriginal text messages encountered

Source
increment_upvotes

Increment the number of upvotes given

Source
karma_counts

Returns a hash of Karma to `Int32 , containing the total number of karma given or lost, and daily, weekly, and monthly totals

Source
karma_level_count(start_value : Int32, end_value : Int32) : Int32

Returns an Int32 total of users whose karma lie between start_value and end_value

Source
karma_levels_screen(services : Services) : String

Returns a formatted String containing karma level counts

Source
karma_screen(services : Services) : String

Returns a formatted String containing karma counts

Source
keyboard_markup(next_screen : StatScreens, services : Services) : Tourmaline::InlineKeyboardMarkup

Returns the Tourmaline::InlineKeyboardMarkup for the given next_screen.

Keyboard buttons are localized and displayed in rows of 3 buttons.

Source
message_counts

Returns a hash of Messages to Int32, containing the total number of message for each type and daily, weekly, and monthly totals

Source
messages_screen(services : Services) : String

Returns a formatted String containing messages counts

Source
percent_change(initial : Int32, final : Int32) : Float64

Returns a Float64 containing the percent change from initial to final

Source
robot9000_counts

Returns a hash of Robot9000 to Int32, containing the total number of unique and unoriginal messages for texts and media types

Source
robot9000_screen(services : Services) : String

Returns a formatted String containing Robot9000 counts

Source
start_date

Returns a String containing the date at which the statistics module was initialized

Source
start_time

Get the Time the module was initialized, which should coincide closely with the time the bot was started. Used to calculate uptime.

Source
statistic_screen(next_screen : StatScreens, services : Services) : String

Returns a String of the formatted statistics screen based on the given next_screen

Source
uptime

Returns a Time::Span containing the amount of time the bot has been running

Source
user_counts

Returns a hash of Users to Int32, containing the total number of each kind of user and daily, weekly, and monthly totals

Source
users_screen(services : Services) : String

Returns a formatted String containing a counts of user totals

Source

Nested types