class

PrivateParlorXT::SQLiteUser

Inherits DB::Mappable < PrivateParlorXT::User < Reference < Object

An implementation of User for the the SQLiteDatabase

Constructors

new(__temp_104 : DB::ResultSet)
Source
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

Source

Class methods

from_rs(__temp_104 : DB::ResultSet)
Source

Instance methods

blacklist_reason

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

Source
blacklist_reason=(_blacklist_reason : Union(String, Nil) | Nil)
Source
cooldown_until

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

Source
cooldown_until=(_cooldown_until : Union(Time, Nil) | Nil)
Source
debug_enabled

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

Source
debug_enabled=(_debug_enabled : Union(Bool, Nil) | Nil)
Source
hide_karma

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

Source
hide_karma=(_hide_karma : Union(Bool, Nil) | Nil)
Source
id

Returns the user's ID

Source
id=(_id : UserID)
Source
joined

Returns the Time the user joined the chat

Source
joined=(_joined : Time)
Source
karma

Returns the user's current amount of karma

Source
karma=(_karma : Int32)
Source
last_active

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

Source
last_active=(_last_active : Time)
Source
left

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

Source
left=(_left : Union(Time, Nil) | Nil)
Source
rank

Returns the user's current rank value

Source
rank=(_rank : Int32)
Source
realname

Returns the user's full name

Source
realname=(_realname : String)
Source
tripcode

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

Source
tripcode=(_tripcode : Union(String, Nil) | Nil)
Source
username

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

Source
username=(_username : Union(String, Nil) | Nil)
Source
warn_expiry

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

Source
warn_expiry=(_warn_expiry : Union(Time, Nil) | Nil)
Source
warnings

Returns the number of warnings the user has

Source
warnings=(_warnings : Int32)
Source