abstract class PrivateParlorXT::Handler
- PrivateParlorXT::Handler
- Reference
- Object
Overview
The base class for all message handlers
Direct Known Subclasses
Defined in:
private-parlor-xt/handler.crConstructors
-
.new(config : Config)
Initializes an instance of
Handler
Instance Method Summary
-
#do(message : Tourmaline::Message, services : Services) : Nil
The function that describes the behavior of the
Handler
-
#reply_message(user : User, message : Tourmaline::Message, services : Services) : Tourmaline::Message | Nil
Returns the given message's reply, if it exists
- #reply_user(user : User, reply_message : Tourmaline::Message, services : Services) : User | Nil
-
#unique?(user : User, message : Tourmaline::Message, services : Services, text : String | Nil = nil) : Bool
Checks the given message for uniqueness and returns
true
if the message is unique -
#update_user_activity(user : User, services : Services) : Nil
Updates the given user's last_active attribute to the current time
Constructor Detail
Initializes an instance of Handler
The config can be used to modify the functionality of the handler
Instance Method Detail
The function that describes the behavior of the Handler
Returns the given message's reply, if it exists
Returns the reply_message's User
if he exists and the reply_message is still available in the History
Checks the given message for uniqueness and returns true
if the message is unique
Returns false
if the message is unoriginal
Updates the given user's last_active attribute to the current time