abstract class PrivateParlorXT::HearsHandler
- PrivateParlorXT::HearsHandler
- PrivateParlorXT::Handler
- Reference
- Object
Overview
A base class for handling messages whose text matches a certain pattern.
Handlers that are meant to match patterns in text should inherit from this class,
and include an Hears
annotation to have it be usable by the bot.
Direct Known Subclasses
Defined in:
private-parlor-xt/handlers/hears_handler.crInstance Method Summary
-
#deny_user(user : User, services : Services) : Nil
Queues a system reply when the message matched is from a user who is blacklisted
-
#karma_reason(reason : String | Nil, karma_reply : String, services : Services) : String
Format the reason for karma related replies
-
#truncate_karma_reason(reason : String | Nil) : String | Nil
Return the first 500 characters of the given reason
Instance methods inherited from class PrivateParlorXT::Handler
do(message : Tourmaline::Message, services : Services) : Nil
do,
reply_message(user : User, message : Tourmaline::Message, services : Services) : Tourmaline::Message | Nil
reply_message,
reply_user(user : User, reply_message : Tourmaline::Message, services : Services) : User | Nil
reply_user,
unique?(user : User, message : Tourmaline::Message, services : Services, text : String | Nil = nil) : Bool
unique?,
update_user_activity(user : User, services : Services) : Nil
update_user_activity
Constructor methods inherited from class PrivateParlorXT::Handler
new(config : Config)
new
Instance Method Detail
Queues a system reply when the message matched is from a user who is blacklisted
Format the reason for karma related replies
def truncate_karma_reason(reason : String | Nil) : String | Nil
#
Return the first 500 characters of the given reason