abstract class PrivateParlorXT::Statistics

Overview

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

Direct Known Subclasses

Defined in:

private-parlor-xt/statistics/statistics.cr

Instance Method Summary

Instance Method Detail

def config_screen(services : Services) : String #

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


[View source]
def configuration_details(services : Services) : Hash(BotInfo, String) #

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


[View source]
def full_users_screen(services : Services) : String #

Returns a formatted String containing user counts


[View source]
abstract def increment_downvotes : Nil #

Increment the number of downvotes given


[View source]
abstract def increment_messages(type : Messages) : Nil #

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


[View source]
abstract def increment_unoriginal_media : Nil #

Increment the number of unoriginal media messages encountered


[View source]
abstract def increment_unoriginal_text : Nil #

Increment the number of unoriginal text messages encountered


[View source]
abstract def increment_upvotes : Nil #

Increment the number of upvotes given


[View source]
abstract def karma_counts : Hash(Karma, Int32) #

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


[View source]
abstract def 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


[View source]
def karma_levels_screen(services : Services) : String #

Returns a formatted String containing karma level counts


[View source]
def karma_screen(services : Services) : String #

Returns a formatted String containing karma counts


[View source]
def 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.


[View source]
abstract def message_counts : Hash(Messages, Int32) #

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


[View source]
def messages_screen(services : Services) : String #

Returns a formatted String containing messages counts


[View source]
def percent_change(initial : Int32, final : Int32) : Float64 #

Returns a Float64 containing the percent change from initial to final


[View source]
abstract def robot9000_counts : Hash(Robot9000, Int32) #

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


[View source]
def robot9000_screen(services : Services) : String #

Returns a formatted String containing Robot9000 counts


[View source]
abstract def start_date : String #

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


[View source]
def start_time : Time #

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


[View source]
def statistic_screen(next_screen : StatScreens, services : Services) : String #

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


[View source]
def uptime : Time::Span #

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


[View source]
abstract def user_counts : Hash(Users, Int32) #

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


[View source]
def users_screen(services : Services) : String #

Returns a formatted String containing a counts of user totals


[View source]