class PrivateParlorXT::SQLiteUser

Overview

An implementation of User for the the SQLiteDatabase

Included Modules

Defined in:

private-parlor-xt/database/SQLite/sqlite_user.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class PrivateParlorXT::User

blacklist(reason : String | Nil) : Nil blacklist, blacklist_reason : String | Nil blacklist_reason, blacklisted? : Bool blacklisted?, can_chat?(limit : Time::Span) : Bool
can_chat? : Bool
can_chat?
, can_use_command? : Bool can_use_command?, cooldown(base : Int32) : Time::Span
cooldown(time : Time::Span) : Time::Span
cooldown
, cooldown_until : Time | Nil cooldown_until, debug_enabled : Bool | Nil debug_enabled, decrement_karma(amount : Int32 = 1) : Nil decrement_karma, formatted_name : String formatted_name, hide_karma : Bool | Nil hide_karma, id : UserID id, increment_karma(amount : Int32 = 1) : Nil increment_karma, joined : Time joined, karma : Int32 karma, last_active : Time last_active, left : Time | Nil left, left? : Bool left?, obfuscated_id : String obfuscated_id, obfuscated_karma : Int32 obfuscated_karma, rank : Int32 rank, realname : String realname, rejoin : Nil rejoin, remove_cooldown(override : Bool = false) : Bool remove_cooldown, remove_warning(amount : Int32, warn_lifespan : Time::Span) : Nil remove_warning, set_active : Nil set_active, set_left : Nil set_left, set_rank(rank : Int32) : Nil set_rank, set_tripcode(tripcode : String) : Nil set_tripcode, to_a : Array(UserID | String | Int32 | Time | Bool | Nil) to_a, toggle_debug : Nil toggle_debug, toggle_karma : Nil toggle_karma, tripcode : String | Nil tripcode, update_names(username : String | Nil, fullname : String) : Nil update_names, username : String | Nil username, warn(lifespan : Int32) : Nil warn, warn_expiry : Time | Nil warn_expiry, warnings : Int32 warnings

Constructor methods inherited from class PrivateParlorXT::User

new(id : UserID, username : String | Nil = nil, realname : String = "", rank : Int32 = 0, joined : Time = Time.utc, left : Time | Nil = nil, last_active : Time = Time.utc, cooldown_until : Time | Nil = nil, blacklist_reason : String | Nil = nil, warnings : Int32 = 0, warn_expiry : Time | Nil = nil, karma : Int32 = 0, hide_karma : Bool | Nil = false, debug_enabled : Bool | Nil = false, tripcode : String | Nil = nil) new

Constructor Detail

def self.new(__temp_87 : DB::ResultSet) #

[View source]
def self.new(id : Int64, username : String | Nil = nil, realname : String = "", rank : Int32 = 0, joined : Time = Time.utc, left : Time | Nil = nil, last_active : Time = Time.utc, cooldown_until : Time | Nil = nil, blacklist_reason : String | Nil = nil, warnings : Int32 = 0, warn_expiry : Time | Nil = nil, karma : Int32 = 0, hide_karma : Bool | Nil = false, debug_enabled : Bool | Nil = false, tripcode : String | Nil = nil) #

Creates an instance of SQLiteUser.

Arguments:

#id : unique UserID identifier for this user

#username : username of this user; can be nil

#realname : full name (first name + last name) of the user

#rank : rank of this user, corresponding to either -10 (blacklisted) or one of the configurable ranks

#joined : date and time the user joined the chat

#left : date and time the user left the chat; if nil, the user is still in the chat

#last_active : date and time the user last sent a message or used a command

#cooldown_until : date and time for until which the user cannot send messages; if nil, the user is not in cooldown

#blacklist_reason : described reason for blacklisting the user (seeBlacklistCommand) ; set to nil by default

#warnings : number of warnings the user received from WarnCommand or DeleteCommand; cooldown times are based off of this value

#warn_expiry : date and time in which one of the #warnings will be removed; if nil, user has no #warnings to remove

#karma : points the user acquired from upvotes, or lost from downvotes and warnings (see UpvoteHandler, DownvoteHandler)

#hide_karma : toggle for receiving karma notifications (see ToggleKarmaCommand); if true, the user will not receive karma notifications

#debug_enabled : toggle for debug mode (see ToggleDebugCommand); if true, the user will receive a copy of their sent message that everyone else received

#tripcode : a name and password pairing used for generating pseudononyms attached to the user's message; if nil, user has no tripcode


[View source]

Class Method Detail

def self.from_rs(__temp_87 : DB::ResultSet) #

[View source]

Instance Method Detail

def blacklist_reason : String? #
Description copied from class PrivateParlorXT::User

Returns the reason why the user was blacklisted, or nil if a reason does not exist


[View source]
def blacklist_reason=(_blacklist_reason : Union(String, Nil) | Nil) #

[View source]
def cooldown_until : Time? #
Description copied from class PrivateParlorXT::User

Returns the Time until which the user is in cooldown, or nil if the user is not cooldowned


[View source]
def cooldown_until=(_cooldown_until : Union(Time, Nil) | Nil) #

[View source]
def debug_enabled : Bool? #
Description copied from class PrivateParlorXT::User

Returns true if the suer has debug mode enabled, false otherwise


[View source]
def debug_enabled=(_debug_enabled : Union(Bool, Nil) | Nil) #

[View source]
def hide_karma : Bool? #
Description copied from class PrivateParlorXT::User

Returns true if the user has karma notifications disabled, false otherwise


[View source]
def hide_karma=(_hide_karma : Union(Bool, Nil) | Nil) #

[View source]
def id : Int64 #
Description copied from class PrivateParlorXT::User

Returns the user's ID


[View source]
def id=(_id : UserID) #

[View source]
def joined : Time #
Description copied from class PrivateParlorXT::User

Returns the Time the user joined the chat


[View source]
def joined=(_joined : Time) #

[View source]
def karma : Int32 #
Description copied from class PrivateParlorXT::User

Returns the user's current amount of karma


[View source]
def karma=(_karma : Int32) #

[View source]
def last_active : Time #
Description copied from class PrivateParlorXT::User

Returns the Time the user was last active (i.e., the last time a message was sent or a command was used)


[View source]
def last_active=(_last_active : Time) #

[View source]
def left : Time? #
Description copied from class PrivateParlorXT::User

Returns the Time the user left the chat, or nil if the user has not left


[View source]
def left=(_left : Union(Time, Nil) | Nil) #

[View source]
def rank : Int32 #
Description copied from class PrivateParlorXT::User

Returns the user's current rank value


[View source]
def rank=(_rank : Int32) #

[View source]
def realname : String #
Description copied from class PrivateParlorXT::User

Returns the user's full name


[View source]
def realname=(_realname : String) #

[View source]
def tripcode : String? #
Description copied from class PrivateParlorXT::User

Returns a String containing the user's tripcode name and password for generating tripcodes, or nil if the user has no tripcode set


[View source]
def tripcode=(_tripcode : Union(String, Nil) | Nil) #

[View source]
def username : String? #
Description copied from class PrivateParlorXT::User

Returns the user's unformatted username, or nil if it does not exist


[View source]
def username=(_username : Union(String, Nil) | Nil) #

[View source]
def warn_expiry : Time? #
Description copied from class PrivateParlorXT::User

Returns the Time when one of the #warnings will expire, or nil if such a time does not exit


[View source]
def warn_expiry=(_warn_expiry : Union(Time, Nil) | Nil) #

[View source]
def warnings : Int32 #
Description copied from class PrivateParlorXT::User

Returns the number of warnings the user has


[View source]
def warnings=(_warnings : Int32) #

[View source]