Tourmaline::Client
Inherits Tourmaline::EventHandler::Annotator < Tourmaline::Client::TDLightMethods < Tourmaline::Client::WebhookMethods < Tourmaline::Client::StickerMethods < Tourmaline::Client::PollMethods < Tourmaline::Client::PaymentMethods < Tourmaline::Client::PassportMethods < Tourmaline::Client::GameMethods < Tourmaline::Client::CoreMethods < Tourmaline::Logger < Reference < Object
The Client class is the base class for all Tourmaline based bots.
Extend this class to create your own bots, or create an
instance of Client and add event handlers to it.
Constants
Constructors
Create a new instance of Tourmaline::Client.
Named Arguments
bot_token
: the bot token you should've received from @BotFather
user_token
: the token returned by the #login method
endpoint
: the API endpoint to use for requests; default is https://api.telegram.org, but for
TDLight methods to work you may consider hosting your own instance or using one of
the official ones such as https://telegram.rest
persistence
: the persistence strategy to use
set_commands
: if true, set_my_commands will be run on start and any commands marked with register
will be registered with BotFather.
pool_capacity
: the maximum number of concurrent HTTP connections to use
initial_pool_size
: the number of HTTP::Client instances to create on init
pool_timeout
: How long to wait for a new client to be available if the pool is full before throwing a TimeoutError
proxy
: an instance of HTTP::Proxy::Client to use; if set, overrides the following proxy_ args
proxy_uri
: a URI to use when connecting to the proxy; can be a URI instance or a String
proxy_host
: if no proxy_uri is provided, this will be the host for the URI
proxy_port
: if no proxy_uri is provided, this will be the port for the URI
proxy_user
: a username to use for a proxy that requires authentication
proxy_pass
: a password to use for a proxy that requires authentication
Class methods
Default prefixes to use for commands
Default parse mode to use for commands when it isn't included explicitly
Instance methods
Gets the name of the Client at the time the Client was
started. Refreshing can be done by setting
@bot to get_me.
Gets the name of the Client at the time the Client was
started. Refreshing can be done by setting
@bot to get_me.
Calls all handlers in the stack with the given update and this client instance.