class PrivateParlorXT::DownvoteHandler
- PrivateParlorXT::DownvoteHandler
- PrivateParlorXT::HearsHandler
- PrivateParlorXT::Handler
- Reference
- Object
Overview
A command-like HearsHandler
used for downvote messages sent by other users.
Defined in:
private-parlor-xt/handlers/hears_handlers/downvote_handler.crInstance Method Summary
-
#authorized?(user : User, message : Tourmaline::Message, authority : CommandPermissions, services : Services) : Bool
Checks if the user is authorized to downvote a message
-
#do(message : Tourmaline::Message, services : Services) : Nil
Downvotes the message that the given message replies to if it meets requirements
-
#downvote_message(user : User, reply_user : User, message : Tourmaline::Message, reply : Tourmaline::Message, services : Services) : Bool
Adds user's dowvote to message history and update reply_user's karma Returns false if user has already downvoted the message or user attempted to remove his own karma
-
#karma_level_down(reply_user : User, reply_parameters : ReplyParameters | Nil, services : Services) : Nil
Checks if the user has lost a karma level when karma levels are set, and if so, queues a 'leveled down' response
-
#record_message_statistics(services : Services) : Nil
Records message statistics about downvotes if the
Statistics
module is enabled -
#send_replies(user : User, reply_user : User, message : Tourmaline::Message, reply : Tourmaline::Message, services : Services) : Nil
Queues 'gave downvote' and 'got downvoted' replies for the user and reply_user, respectively
-
#spamming?(user : User, message : Tourmaline::Message, services : Services) : Bool
Checks if the user is spamming downvotes
- #user_from_message(message : Tourmaline::Message, services : Services) : User | Nil
Instance methods inherited from class PrivateParlorXT::HearsHandler
deny_user(user : User, services : Services) : Nil
deny_user,
karma_reason(reason : String | Nil, karma_reply : String, services : Services) : String
karma_reason,
truncate_karma_reason(reason : String | Nil) : String | Nil
truncate_karma_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
Checks if the user is authorized to downvote a message
Returns true
if so, false
otherwise
Downvotes the message that the given message replies to if it meets requirements
Adds user's dowvote to message history and update reply_user's karma Returns false if user has already downvoted the message or user attempted to remove his own karma
Checks if the user has lost a karma level when karma levels are set, and if so, queues a 'leveled down' response
Records message statistics about downvotes if the Statistics
module is enabled
Queues 'gave downvote' and 'got downvoted' replies for the user and reply_user, respectively
Includes a reason for the downvote if karma reasons are enabled.
Checks if the user is spamming downvotes
Returns true
if the user is spamming downvotes, false
otherwise