class PrivateParlorXT::Relay
- PrivateParlorXT::Relay
- Reference
- Object
Overview
Handles the MessageQueue
and sends prepared messages to Telegram
Defined in:
private-parlor-xt/relay/relay.crConstructors
Instance Method Summary
-
#cache_message(success : Tourmaline::Message | Array(Tourmaline::Message), message : QueuedMessage, services : Services) : Nil
Caches data from the message returned from Telegram in the message
History
-
#delete_message(receiver : UserID, message : MessageID) : Nil
Delete a message for receiver
-
#edit_message_media(user : UserID, media : Tourmaline::InputMedia, message : MessageID) : Nil
Edit a message's media, usually used for placing a spoiler on a message
-
#edit_message_text(user : UserID, text : String, markup : Tourmaline::InlineKeyboardMarkup | Nil, message : MessageID) : Nil
Exit a message's text
-
#get_chat(user : UserID) : Tourmaline::ChatFullInfo | Nil
Returns the full chat information for the given user
-
#log_output(text : String) : Nil
Prints text to the log and send it to the
log_channel
if it is set -
#pin_message(user : UserID, message : MessageID) : Nil
Pins the given message to the chat
-
#purge_messages(receiver : UserID, messages : Array(MessageID)) : Nil
Bulk dellete messages for a given receiver
-
#reject_blacklisted_messages(user : UserID) : Nil
Remove messages from the queue that are sent by or addressed to user
-
#reject_inactive_user_messages(user : UserID) : Nil
Remove messages from the queue that are addressed to user
-
#relay_message(message : QueuedMessage, services : Services) : Tourmaline::Message | Array(Tourmaline::Message) | Nil
Calls the proc associated with the given message.
-
#send_album(params : AlbumHelpers::AlbumRelayParameters) : Nil
Queues an album with the given params
-
#send_animation(params : RelayParameters) : Nil
Queues a GIF with the given params
-
#send_audio(params : RelayParameters) : Nil
Queues an audio message with the given params
-
#send_contact(params : RelayParameters, contact : Tourmaline::Contact) : Nil
Queues a
Tourmaline::Contact
with the given params -
#send_document(params : RelayParameters) : Nil
Queues a document with the given params
-
#send_forward(params : RelayParameters, message : MessageID) : Nil
Queues a forwarded message with the given params
-
#send_location(params : RelayParameters, location : Tourmaline::Location) : Nil
Queues a
Tourmaline::Location
with the given params -
#send_message(services : Services) : Bool | Nil
Takes a message from the queue and sends it.
-
#send_photo(params : RelayParameters) : Nil
Queues a photo with the given params
-
#send_poll_copy(reply : MessageID, user : User, effect : String | Nil, poll : Tourmaline::Poll) : Tourmaline::Message
Sends a
Tourmaline::Poll
with the given parameters found in poll -
#send_sticker(params : RelayParameters) : Nil
Queues a sticker with the given params
-
#send_text(params : RelayParameters) : Nil
Queues a text message with the given params
-
#send_to_channel(reply_message : MessageID | Nil, channel : String, text : String) : Nil
Relay a message to the log channel.
-
#send_to_user(reply_message : ReplyParameters | Nil, user : UserID, text : String, reply_markup : Tourmaline::InlineKeyboardMarkup | Nil = nil) : Nil
Relay a message to a single user.
-
#send_venue(params : RelayParameters, venue : Tourmaline::Venue) : Nil
Queues a
Tourmaline::Venue
with the given params -
#send_video(params : RelayParameters) : Nil
Queues a video with the given params
-
#send_video_note(params : RelayParameters) : Nil
Queues a video note with the given params
-
#send_voice(params : RelayParameters) : Nil
Queues a voice message with the given params
-
#set_log_channel(channel_id : String) : Nil
Set the log chanel ID to channel_id
-
#start_polling
Start polling Telegram for updates
-
#stop_polling
Stop polling Telegram for updates
-
#unpin_message(user : UserID, message : MessageID | Nil = nil) : Nil
Unpins the most recent message from the chat, or unpins the given message
Constructor Detail
Instance Method Detail
Caches data from the message returned from Telegram in the message History
Delete a message for receiver
Edit a message's media, usually used for placing a spoiler on a message
Exit a message's text
Returns the full chat information for the given user
Prints text to the log and send it to the log_channel
if it is set
Pins the given message to the chat
Bulk dellete messages for a given receiver
Remove messages from the queue that are sent by or addressed to user
Remove messages from the queue that are addressed to user
Calls the proc associated with the given message.
Returns a Tourmaline::Message
when sending messages that are not albums
Returns an array of Tourmaline::Message
for sent albums
Returns nil on sending a system message, Telegram giving us a boolean,
or encountering an error
Queues an album with the given params
Queues a Tourmaline::Contact
with the given params
Queues a forwarded message with the given params
Queues a Tourmaline::Location
with the given params
Takes a message from the queue and sends it.
Returns true if queue is empty
Sends a Tourmaline::Poll
with the given parameters found in poll
Relay a message to the log channel.
Relay a message to a single user. Used for system messages.
Queues a Tourmaline::Venue
with the given params
Unpins the most recent message from the chat, or unpins the given message