struct Tourmaline::Context

Defined in:

tourmaline/context.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(client : Client, update : Update) #

[View source]

Instance Method Detail

def answer_callback_query(**kwargs) #

[View source]
def answer_inline_query(**kwargs) #

[View source]
def answer_pre_checkout_query(**kwargs) #

[View source]
def answer_shipping_query(**kwargs) #

[View source]
def api : Tourmaline::Client #

Slightly shorter alias for the client


[View source]
def callback_query(*args, **options) #

Pass all update methods to the update object


[View source]
def callback_query(*args, **options, &) #

Pass all update methods to the update object


[View source]
def callback_query?(*args, **options) #

Pass all update methods to the update object


[View source]
def callback_query?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def channel_post(*args, **options) #

Pass all update methods to the update object


[View source]
def channel_post(*args, **options, &) #

Pass all update methods to the update object


[View source]
def channel_post?(*args, **options) #

Pass all update methods to the update object


[View source]
def channel_post?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def chosen_inline_result(*args, **options) #

Pass all update methods to the update object


[View source]
def chosen_inline_result(*args, **options, &) #

Pass all update methods to the update object


[View source]
def chosen_inline_result?(*args, **options) #

Pass all update methods to the update object


[View source]
def chosen_inline_result?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def client : Client #

[View source]
def command #

Get the command name, return nil if there is no message


[View source]
def command! #

Get the command name, raise an exception if there is no message


[View source]
def delete_message(message_id : Int32) #

Context aware message deletion


[View source]
def edit_live_location(latitude : Float64, longitude : Float64, **kwargs) #

Context aware live location editing


[View source]
def edit_message(text : String, **kwargs) #

Context aware editing


[View source]
def edited_channel_post(*args, **options) #

Pass all update methods to the update object


[View source]
def edited_channel_post(*args, **options, &) #

Pass all update methods to the update object


[View source]
def edited_channel_post?(*args, **options) #

Pass all update methods to the update object


[View source]
def edited_channel_post?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def edited_message(*args, **options) #

Pass all update methods to the update object


[View source]
def edited_message(*args, **options, &) #

Pass all update methods to the update object


[View source]
def edited_message?(*args, **options) #

Pass all update methods to the update object


[View source]
def edited_message?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def forward_message(to_chat, **kwargs) #

Context aware forward


[View source]
def inline_query(*args, **options) #

Pass all update methods to the update object


[View source]
def inline_query(*args, **options, &) #

Pass all update methods to the update object


[View source]
def inline_query?(*args, **options) #

Pass all update methods to the update object


[View source]
def inline_query?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def message #

Retuns the message, edited_message, channel_post, edited_channel_post, callback_query.message, or nil


[View source]
def message(*args, **options) #

Pass all update methods to the update object


[View source]
def message(*args, **options, &) #

Pass all update methods to the update object


[View source]
def message! #

Returns the message, edited_message, channel_post, edited_channel_post, callback_query.message, or raises an exception


[View source]
def message?(*args, **options) #

Pass all update methods to the update object


[View source]
def message?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def pin_message(**kwargs) #

Context aware pinning


[View source]
def poll(*args, **options) #

Pass all update methods to the update object


[View source]
def poll(*args, **options, &) #

Pass all update methods to the update object


[View source]
def poll?(*args, **options) #

Pass all update methods to the update object


[View source]
def poll?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def poll_answer(*args, **options) #

Pass all update methods to the update object


[View source]
def poll_answer(*args, **options, &) #

Pass all update methods to the update object


[View source]
def poll_answer?(*args, **options) #

Pass all update methods to the update object


[View source]
def poll_answer?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def pre_checkout_query(*args, **options) #

Pass all update methods to the update object


[View source]
def pre_checkout_query(*args, **options, &) #

Pass all update methods to the update object


[View source]
def pre_checkout_query?(*args, **options) #

Pass all update methods to the update object


[View source]
def pre_checkout_query?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def reply(text : String, **kwargs) #

Reply directly to the incoming message


[View source]
def reply_with_animation(animation, **kwargs) #

Reply directly to the incoming message with a animation


[View source]
def reply_with_audio(audio, **kwargs) #

Reply directly to the incoming message with a audio


[View source]
def reply_with_basketball(**kwargs) #

Reply directly to the incoming message with a basketball


[View source]
def reply_with_bowling(**kwargs) #

Reply directly to the incoming message with a bowling


[View source]
def reply_with_contact(contact, **kwargs) #

Reply directly to the incoming message with a contact


[View source]
def reply_with_dart(**kwargs) #

Reply directly to the incoming message with a dart


[View source]
def reply_with_dice(**kwargs) #

Reply directly to the incoming message with a dice


[View source]
def reply_with_document(document, **kwargs) #

Reply directly to the incoming message with a document


[View source]
def reply_with_football(**kwargs) #

Reply directly to the incoming message with a football


[View source]
def reply_with_invoice(invoice, **kwargs) #

Reply directly to the incoming message with a invoice


[View source]
def reply_with_location(latitude : Float64, longitude : Float64, **kwargs) #

Reply directly to the incoming message with a location


[View source]
def reply_with_media_group(media_group, **kwargs) #

Reply directly to the incoming message with a media_group


[View source]
def reply_with_photo(photo, **kwargs) #

Reply directly to the incoming message with a photo


[View source]
def reply_with_poll(question : String, options : Array(String), **kwargs) #

Reply directly to the incoming message with a poll


[View source]
def reply_with_slot_machine(**kwargs) #

Reply directly to the incoming message with a slot_machine


[View source]
def reply_with_sticker(sticker, **kwargs) #

Reply directly to the incoming message with a sticker


[View source]
def reply_with_venue(venue, **kwargs) #

Reply directly to the incoming message with a venue


[View source]
def reply_with_video(video, **kwargs) #

Reply directly to the incoming message with a video


[View source]
def reply_with_video_note(video_note, **kwargs) #

Reply directly to the incoming message with a video_note


[View source]
def reply_with_voice(voice, **kwargs) #

Reply directly to the incoming message with a voice


[View source]
def respond(text : String, **kwargs) #

Respond to the incoming message


[View source]
def respond_with_animation(animation, **kwargs) #

Respond with a animation


[View source]
def respond_with_audio(audio, **kwargs) #

Respond with a audio


[View source]
def respond_with_basketball(**kwargs) #

Respond with a basketball


[View source]
def respond_with_bowling(**kwargs) #

Respond with a bowling


[View source]
def respond_with_contact(contact, **kwargs) #

Respond with a contact


[View source]
def respond_with_dart(**kwargs) #

Respond with a dart


[View source]
def respond_with_dice(**kwargs) #

Respond with a dice


[View source]
def respond_with_document(document, **kwargs) #

Respond with a document


[View source]
def respond_with_football(**kwargs) #

Respond with a football


[View source]
def respond_with_invoice(invoice, **kwargs) #

Respond with a invoice


[View source]
def respond_with_location(latitude : Float64, longitude : Float64, **kwargs) #

Respond with a location


[View source]
def respond_with_media_group(media_group, **kwargs) #

Respond with a media_group


[View source]
def respond_with_photo(photo, **kwargs) #

Respond with a photo


[View source]
def respond_with_poll(question : String, options : Array(String), **kwargs) #

Respond with a poll


[View source]
def respond_with_slot_machine(**kwargs) #

Respond with a slot_machine


[View source]
def respond_with_sticker(sticker, **kwargs) #

Respond with a sticker


[View source]
def respond_with_venue(venue, **kwargs) #

Respond with a venue


[View source]
def respond_with_video(video, **kwargs) #

Respond with a video


[View source]
def respond_with_video_note(video_note, **kwargs) #

Respond with a video_note


[View source]
def respond_with_voice(voice, **kwargs) #

Respond with a voice


[View source]
def send_chat_action(action : String | ChatAction) #

Context aware chat actions


[View source]
def shipping_query(*args, **options) #

Pass all update methods to the update object


[View source]
def shipping_query(*args, **options, &) #

Pass all update methods to the update object


[View source]
def shipping_query?(*args, **options) #

Pass all update methods to the update object


[View source]
def shipping_query?(*args, **options, &) #

Pass all update methods to the update object


[View source]
def text(strip_command = true) #

Get the message text, return nil if there is no message


[View source]
def text!(strip_command = true) #

Get the message text, raise an exception if there is no message


[View source]
def unpin_message(**kwargs) #

Context aware unpinning


[View source]
def update : Update #

[View source]
def with_message(&) #

If the update contains a message, pass it to the block. Less boilerplate.


[View source]