class Telecr::Core::Bot

Defined in:

core/bot.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(token : String) #

[View source]

Instance Method Detail

def client : Telecr::Api::Client #

[View source]
def command(name : String, &block : Context -> ) #

Preserving existing Command Logic


[View source]
def composer : Composer #

[View source]
def get_user_profile_audios(user_id : Int64, offset : Int32 | Nil = nil, limit : Int32 | Nil = nil) #

New for API 9.6: User Profile Audios


[View source]
def hears(pattern : Regex | String, &block : Context -> ) #

[View source]
def managed_bot(&block : Context -> ) #

New for API 9.6: Managed Bot Handler


[View source]
def on(type : Symbol, **filters, &block : Context -> ) #

[View source]
def process(data : String) #

Process raw data (JSON String or Hash-like)


[View source]
def process(data : Hash | JSON::Any) #

[View source]
def running : Bool #

[View source]
def set_webhook(url : String | Nil = nil, secret_token : String | Nil = nil) #

[View source]
def shutdown #

Standard bot methods...


[View source]
def start_polling #

Start bot in polling mode


[View source]
def start_webhook(path : String = "/webhook", port : Int32 | Nil = nil) #

Start bot in webhook mode


[View source]
def stop_webhook #

[View source]
def webhook_path : String | Nil #

[View source]
def webhook_server : Webhook::Server | Nil #

[View source]