class PrivateParlorXT::PromoteCommand
- PrivateParlorXT::PromoteCommand
- PrivateParlorXT::CommandHandler
- PrivateParlorXT::Handler
- Reference
- Object
Overview
A command used to promote a user to a given rank
Defined in:
private-parlor-xt/handlers/command_handlers/promote_command.crInstance Method Summary
-
#do(message : Tourmaline::Message, services : Services) : Nil
Promotes the user described in the message text or promotes the sender of the message it replies to, if message meets requirements
-
#promote_from_args(text : String | Nil, authority : CommandPermissions, user : User, message : MessageID, services : Services) : Nil
Promotes a user given in the text to the user's current rank if the rank has the
CommandPermissions::Promote
orCommandPermissions::PromoteSame
permission and only one argument (the user's identifier) was given, or promotes to the given rank if the user's rank has theCommandPermissions::Promote
orCommandPermissions::PromoteLower
permission and two arguments (the user's identifier and name/value of rank) was given -
#promote_from_reply(arg : String | Nil, authority : CommandPermissions, user : User, message : MessageID, reply : Tourmaline::Message, services : Services) : Nil
Promotes a user who sent the reply message to the user's current rank if the rank has the
CommandPermissions::Promote
orCommandPermissions::PromoteSame
permission and no arg was given, or promotes to the given rank in arg if the user's rank has theCommandPermissions::Promote
orCommandPermissions::PromoteLower
permission and one argument (name/value of rank) was given
Instance methods inherited from class PrivateParlorXT::CommandHandler
authorized?(user : User, message : Tourmaline::Message, permission : CommandPermissions, services : Services) : Boolauthorized?(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
Promotes the user described in the message text or promotes the sender of the message it replies to, if message meets requirements
Promotes a user given in the text to the user's current rank if the rank has the CommandPermissions::Promote
or CommandPermissions::PromoteSame
permission
and only one argument (the user's identifier) was given, or promotes to the given rank if the user's rank has the CommandPermissions::Promote
or CommandPermissions::PromoteLower
permission
and two arguments (the user's identifier and name/value of rank) was given
Promotes a user who sent the reply message to the user's current rank if the rank has the CommandPermissions::Promote
or CommandPermissions::PromoteSame
permission
and no arg was given, or promotes to the given rank in arg if the user's rank has the CommandPermissions::Promote
or CommandPermissions::PromoteLower
permission
and one argument (name/value of rank) was given