class PrivateParlorXT::BlacklistCommand

Overview

A command used to blacklist a user by args or by replying to a message

Defined in:

private-parlor-xt/handlers/command_handlers/blacklist_command.cr

Instance Method Summary

Instance methods inherited from class PrivateParlorXT::CommandHandler

authorized?(user : User, message : Tourmaline::Message, permission : CommandPermissions, services : Services) : Bool
authorized?(user : User, message : Tourmaline::Message, services : Services, *permissions : CommandPermissions) : CommandPermissions | Nil
authorized?
, delete_messages(message : MessageID, user : UserID, debug_enabled : Bool | Nil, services : Services) : MessageID | Nil delete_messages, deny_user(user : User, services : Services) : Nil deny_user, remove_command_entity(text : String, entities : Array(Tourmaline::MessageEntity), arg : String) : Array(Tourmaline::MessageEntity) remove_command_entity, user_from_message(message : Tourmaline::Message, services : Services) : User | Nil user_from_message

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

def blacklist_from_args(args : Array(String), user : User, message : MessageID, services : Services) : Nil #

Blacklists a user described in args from the chat if the user exists


[View source]
def blacklist_from_reply(reason : String | Nil, user : User, message : MessageID, reply : Tourmaline::Message, services : Services) : Nil #

Blacklists the sender of reply if the message still exists in the cache


[View source]
def blacklist_user(blacklisted_user : User, invoker : User, message : MessageID, reason : String | Nil, services : Services) : Bool | Nil #

Blacklists the blacklisted_user and removes all messages sent by and addressed to him if his rank does not equal to or exceed invoker's rank


[View source]
def do(message : Tourmaline::Message, services : Services) : Nil #

Blacklists the user described in the message text or blacklists the sender of the message it replies to, if message meets requirements


[View source]
def send_messages(reason : String | Nil, blacklisted_user : User, invoker : User, deleted_message : ReplyParameters | Nil, invoker_message : MessageID, services : Services) : Nil #

Queues success and blacklisted responses


[View source]