class Telecr::Core::Context

Defined in:

core/context.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(update : Types::Update, bot : Bot) #

[View source]

Instance Method Detail

def answer(text : String | Nil = nil, show_alert : Bool = false, **options) #

[View source]
def bot : Bot #

[View source]
def bot=(bot : Bot) #

[View source]
def business_connection_id : String | Nil #

API 9.6: Business connection ID for Enterprise bots


[View source]
def callback_query : Types::CallbackQuery | Nil #

[View source]
def chat : Types::Chat | Nil #

Get the chat where this update occurred


[View source]
def chat_id : Int64 | Nil #

[View source]
def command? : Bool #

[View source]
def command_args : String | Nil #

[View source]
def command_name : String | Nil #

[View source]
def data : String | Nil #

[View source]
def document(doc, caption : String | Nil = nil, **options) #

[View source]
def edit_text(text : String, **options) #

[View source]
def from : Types::User | Nil #

Get the user who sent this update


[View source]
def inline_query : JSON::Any | Nil #

[View source]
def managed_bot : Types::ManagedBotUpdated | Nil #

API 9.6: Access managed bot updates


[View source]
def match : Regex::MatchData | Nil #

Match data from pattern matching (command/hears)


[View source]
def match=(match : Regex::MatchData | Nil) #

Match data from pattern matching (command/hears)


[View source]
def message : Types::Message | Nil #

[View source]
def message_id : Int64 | Nil #

[View source]
def photo(photo, caption : String | Nil = nil, **options) #

[View source]
def replied_message : Types::Message | Nil #

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

Send a text message to the current chat


[View source]
def reply? : Bool #

[View source]
def reply_draft(text : String, **options) #

API 9.6: Native streaming draft support


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

[View source]
def session : Hash(String, JSON::Any) #

Session data for this user


[View source]
def session=(session : Hash(String, JSON::Any)) #

Session data for this user


[View source]
def state : Hash(Symbol, JSON::Any) #

Shared state between middlewares - using JSON::Any for flexibility


[View source]
def state=(state : Hash(Symbol, JSON::Any)) #

Shared state between middlewares - using JSON::Any for flexibility


[View source]
def text : String | Nil #

[View source]
def typing_active : Bool #

[View source]
def typing_active=(typing_active : Bool) #

[View source]
def update : Types::Update #

Core properties


[View source]
def update=(update : Types::Update) #

Core properties


[View source]
def user_id : Int64 | Nil #

[View source]
def with_typing(&) #

[View source]