mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 09:55:21 +00:00
303 lines
9.2 KiB
Text
303 lines
9.2 KiB
Text
# SOME DESCRIPTIVE TITLE.
|
|
# Copyright (C) 2023, aiogram Team
|
|
# This file is distributed under the same license as the aiogram package.
|
|
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
|
|
#
|
|
#, fuzzy
|
|
msgid ""
|
|
msgstr ""
|
|
"Project-Id-Version: aiogram \n"
|
|
"Report-Msgid-Bugs-To: \n"
|
|
"POT-Creation-Date: 2023-08-06 16:52+0300\n"
|
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
"MIME-Version: 1.0\n"
|
|
"Content-Type: text/plain; charset=utf-8\n"
|
|
"Content-Transfer-Encoding: 8bit\n"
|
|
"Generated-By: Babel 2.12.1\n"
|
|
|
|
#: ../../dispatcher/webhook.rst:5
|
|
msgid "Webhook"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:7
|
|
msgid ""
|
|
"Telegram Bot API supports webhook. If you set webhook for your bot, "
|
|
"Telegram will send updates to the specified url. You can use "
|
|
":meth:`aiogram.methods.set_webhook.SetWebhook` method to specify a url "
|
|
"and receive incoming updates on it."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:14
|
|
msgid "If you use webhook, you can't use long polling at the same time."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:16
|
|
msgid ""
|
|
"Before start i'll recommend you to read `official Telegram's "
|
|
"documentation about webhook <https://core.telegram.org/bots/webhooks>`_"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:18
|
|
msgid "After you read it, you can start to read this section."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:20
|
|
msgid ""
|
|
"Generally to use webhook with aiogram you should use any async web "
|
|
"framework. By out of the box aiogram has an aiohttp integration, so "
|
|
"we'll use it."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:25
|
|
msgid ""
|
|
"You can use any async web framework you want, but you should write your "
|
|
"own integration if you don't use aiohttp."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:29
|
|
msgid "aiohttp integration"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:31
|
|
msgid "Out of the box aiogram has aiohttp integration, so you can use it."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:33
|
|
msgid ""
|
|
"Here is available few ways to do it using different implementations of "
|
|
"the webhook controller:"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:35
|
|
msgid ""
|
|
":class:`aiogram.webhook.aiohttp_server.BaseRequestHandler` - Abstract "
|
|
"class for aiohttp webhook controller"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:36
|
|
msgid ""
|
|
":class:`aiogram.webhook.aiohttp_server.SimpleRequestHandler` - Simple "
|
|
"webhook controller, uses single Bot instance"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:37
|
|
msgid ""
|
|
":class:`aiogram.webhook.aiohttp_server.TokenBasedRequestHandler` - Token"
|
|
" based webhook controller, uses multiple Bot instances and tokens"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:39
|
|
msgid "You can use it as is or inherit from it and override some methods."
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.__init__:1 of
|
|
msgid ""
|
|
"Base handler that helps to handle incoming request from aiohttp and "
|
|
"propagate it to the Dispatcher"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.__init__
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.register
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.resolve_bot
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.__init__
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.resolve_bot
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.register
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.resolve_bot
|
|
#: aiogram.webhook.aiohttp_server.ip_filter_middleware of
|
|
msgid "Parameters"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.__init__:4
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.__init__:3
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__:9 of
|
|
msgid "instance of :class:`aiogram.dispatcher.dispatcher.Dispatcher`"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.__init__:5 of
|
|
msgid ""
|
|
"immediately responds to the Telegram instead of a waiting end of a "
|
|
"handler process"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.register:1 of
|
|
msgid "Register route and shutdown callback"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.register:3
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.register:3 of
|
|
msgid "instance of aiohttp Application"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.register:4
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.register:4 of
|
|
msgid "route path"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.resolve_bot:1
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.resolve_bot:1 of
|
|
msgid "This method should be implemented in subclasses of this class."
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.resolve_bot:3
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.resolve_bot:3 of
|
|
msgid "Resolve Bot instance from request."
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.resolve_bot
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.resolve_bot
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.resolve_bot
|
|
#: aiogram.webhook.aiohttp_server.ip_filter_middleware of
|
|
msgid "Returns"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.resolve_bot:6
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.resolve_bot:6 of
|
|
msgid "Bot instance"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.__init__:1 of
|
|
msgid "Handler for single Bot instance"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.__init__:4
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__:10 of
|
|
msgid ""
|
|
"immediately responds to the Telegram instead of a waiting end of handler "
|
|
"process"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.__init__:6 of
|
|
msgid "instance of :class:`aiogram.client.bot.Bot`"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.close:1 of
|
|
msgid "Close bot session"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__:1 of
|
|
msgid ""
|
|
"Handler that supports multiple bots the context will be resolved from "
|
|
"path variable 'bot_token'"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__:6 of
|
|
msgid ""
|
|
"This handler is not recommended in due to token is available in URL and "
|
|
"can be logged by reverse proxy server or other middleware."
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__:12 of
|
|
msgid "kwargs that will be passed to new Bot instance"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.register:1 of
|
|
msgid "Validate path, register route and shutdown callback"
|
|
msgstr ""
|
|
|
|
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.resolve_bot:1 of
|
|
msgid "Get bot token from a path and create or get from cache Bot instance"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:51
|
|
msgid "Security"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:53
|
|
msgid ""
|
|
"Telegram supports two methods to verify incoming requests that they are "
|
|
"from Telegram:"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:56
|
|
msgid "Using a secret token"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:58
|
|
msgid ""
|
|
"When you set webhook, you can specify a secret token and then use it to "
|
|
"verify incoming requests."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:61
|
|
msgid "Using IP filtering"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:63
|
|
msgid ""
|
|
"You can specify a list of IP addresses from which you expect incoming "
|
|
"requests, and then use it to verify incoming requests."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:65
|
|
msgid ""
|
|
"It can be acy using firewall rules or nginx configuration or middleware "
|
|
"on application level."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:67
|
|
msgid ""
|
|
"So, aiogram has an implementation of the IP filtering middleware for "
|
|
"aiohttp."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:75
|
|
msgid "Examples"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:78
|
|
msgid "Behind reverse proxy"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:80
|
|
msgid ""
|
|
"In this example we'll use aiohttp as web framework and nginx as reverse "
|
|
"proxy."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:84
|
|
msgid ""
|
|
"When you use nginx as reverse proxy, you should set `proxy_pass` to your "
|
|
"aiohttp server address."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:98
|
|
msgid "Without reverse proxy (not recommended)"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:100
|
|
msgid ""
|
|
"In case you want can't use reverse proxy, you can use aiohttp's ssl "
|
|
"context."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:102
|
|
msgid "Also this example contains usage with self-signed certificate."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:108
|
|
msgid "With using other web framework"
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:110
|
|
msgid ""
|
|
"You can pass incoming request to aiogram's webhook controller from any "
|
|
"web framework you want."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:112
|
|
msgid ""
|
|
"Read more about it in "
|
|
":meth:`aiogram.dispatcher.dispatcher.Dispatcher.feed_webhook_update` or "
|
|
":meth:`aiogram.dispatcher.dispatcher.Dispatcher.feed_update` methods."
|
|
msgstr ""
|
|
|
|
#: ../../dispatcher/webhook.rst:123
|
|
msgid ""
|
|
"If you want to use reply into webhook, you should check that result of "
|
|
"the :code:`feed_update` methods is an instance of API method and build "
|
|
":code:`multipart/form-data` or :code:`application/json` response body "
|
|
"manually."
|
|
msgstr ""
|