mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
aiogram is a modern and fully asynchronous framework for Telegram Bot API written in Python using asyncio
* increased Telegram Bot API version * AIOG-T-64 added logOut method * AIOG-T-64 added logOut method test * AIOG-T-64 logOut type annotation fix * AIOG-T-65 added close (close_bot) method * AIOG-T-65 old `close` method deprecation warn * AIOG-T-65 `close_bot` test added * AIOG-T-67 added ip_address param to set_webhook, updated docs * updated deprecation text Co-authored-by: Martin Winks <mpa@snejugal.ru> * AIOG-T-69 param `drop_pending_updates` added in methods `setWebhook` and `deleteWebhook` * AIOG-T-71 new `ChatLocation` class * AIOG-T-70 updated `Chat` class: bio, linked chats, location * AIOG-T-68 field `ip_address` added to class `WebhookInfo` * AIOG-T-72 param `only_if_banned` added to `unbanChatMember` method * AIOG-T-72 updated Chat.unban shortcut * AIOG-T-73 field `file_name` added to `Audio` and `Video` classes * AIOG-T-74 param `disable_content_type_detection` added in `sendDocument` method and `InputMediaDocument` class * AIOG-T-75 Added the ability to pin messages in private chats (docs update) * AIOG-T-76 Added the parameter message_id to the method unpinChatMessage to allow unpinning of the specific pinned message * AIOG-T-77 Added the method unpinAllChatMessages, which can be used to unpin all pinned messages in a chat. * AIOG-T-78 updated send_media_group description; added media qty check * AIOG-T-80 field `live_period` added to `Location` class * AIOG-T-81 Added support for live location heading * AIOG-T-82 added the field proximity_alert_distance to the classes Location, InlineQueryResultLocation, InputLocationMessageContent; fixed heading in InputLocationMessageContent * AIOG-T-82 added parameter proximity_alert_distance to the methods sendLocation and editMessageLiveLocation * AIOG-T-83 Added the type ProximityAlertTriggered * AIOG-T-83 Added field proximity_alert_triggered to the class Message * AIOG-T-84 Added the field horizontal_accuracy to the classes Location, InlineQueryResultLocation, InputLocationMessageContent * AIOG-T-84 Added the parameter horizontal_accuracy to the methods sendLocation and editMessageLiveLocation. * Added live_period to InputLocationMessageContent (missed?) * AIOG-T-85 Added the field sender_chat to the class Message * AIOG-T-86 Added `is_anonymous` field to `chatMember` class * AIOG-T-87 Added the parameter is_anonymous to the method promoteChatMember * AIOG-T-89 Added the method `copyMessage` * AIOG-T-90 Poll docs update * AIOG-T-91 ability to manually specify text entities * AIOG-T-92 Google Places as a venue API provider * AIOG-T-93 Added the field allow_sending_without_reply to the methods * AIOG-T-94 football and slot machine dice * removed Optional Co-authored-by: Ramzan Bekbulatov <bekbulatov.ramzan@ya.ru> * Apply suggestions from code review removed Optional Co-authored-by: Ramzan Bekbulatov <bekbulatov.ramzan@ya.ru> * Don't use deprecated Bot.close method from dispatcher (Replaced by session.close) * Fix copyMessage method, update alias (with deprecation) Fix imports * AIOG-T-79: Easy way to use custom API server * Update docs * Bump requirements * Rollback email * AIOG-T-93 allow_sending_without_reply to send_message shortcuts * AIOG-T-93 added allow_sending_without_reply to send_photo shortcuts * AIOG-T-93 added allow_sending_without_reply to send_video shortcuts * Union[type, None] -> Optional[type] refactoring * AIOG-T-93 added allow_sending_without_reply to send_animation shortcuts * added type hint to reply field * AIOG-T-93 added allow_sending_without_reply to send_audio shortcuts * AIOG-T-93 added allow_sending_without_reply to send_document shortcuts * AIOG-T-93 added allow_sending_without_reply to send_sticker shortcuts * AIOG-T-93 added allow_sending_without_reply to send_video_note shortcuts * AIOG-T-93 added allow_sending_without_reply to send_voice shortcuts * AIOG-T-93 added allow_sending_without_reply to send_location shortcuts * AIOG-T-93 added allow_sending_without_reply to send_venue shortcuts * AIOG-T-93 added allow_sending_without_reply to send_contact shortcuts * AIOG-T-93 added allow_sending_without_reply to send_poll shortcuts * AIOG-T-93 added allow_sending_without_reply to send_dice shortcuts * AIOG-T-93 added allow_sending_without_reply to send_media_group shortcuts * AIOG-T-92 added google_place_ to send_venue shortcuts * AIOG-T-91 added entities to send_message shortcuts * AIOG-T-91 added caption_entities to send_photo shortcuts * AIOG-T-91 added caption_entities to send_video shortcuts * AIOG-T-91 added caption_entities to send_animation shortcuts * AIOG-T-91 added caption_entities to send_audio shortcuts * AIOG-T-91 added caption_entities to send_document shortcuts * AIOG-T-91 added caption_entities to send_voice shortcuts * AIOG-T-91 added explanation_parse_mode to send_poll shortcuts * AIOG-T-91 added entities to edit_message_text shortcuts * AIOG-T-91 added caption_entities to edit_message_caption shortcuts * fixed types.MessageEntity -> MessageEntity in docs Co-authored-by: Martin Winks <mpa@snejugal.ru> Co-authored-by: Ramzan Bekbulatov <bekbulatov.ramzan@ya.ru> Co-authored-by: Alex Root Junior <jroot.junior@gmail.com> |
||
|---|---|---|
| .github | ||
| aiogram | ||
| docs | ||
| examples | ||
| tests | ||
| .gitignore | ||
| .readthedocs.yml | ||
| CODE_OF_CONDUCT.md | ||
| dev_requirements.txt | ||
| environment.yml | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| README.rst | ||
| requirements.txt | ||
| setup.py | ||
| tox.ini | ||
AIOGram
aiogram is a pretty simple and fully asynchronous framework for Telegram Bot API written in Python 3.7 with asyncio and aiohttp. It helps you to make your bots faster and simpler.
Examples
📚 Click to see some basic examples
Few steps before getting started...
- First, you should obtain token for your bot from BotFather.
- Install latest stable version of aiogram, simply running
pip install aiogram
Simple getMe request
import asyncio
from aiogram import Bot
async def main():
bot = Bot(token=BOT-TOKEN)
try:
me = await bot.get_me()
print(f"🤖 Hello, I'm {me.first_name}.\nHave a nice Day!")
finally:
await bot.close()
asyncio.run(main())
Poll BotAPI for updates and process updates
import asyncio
from aiogram import Bot, Dispatcher, types
async def start_handler(event: types.Message):
await event.answer(
f"Hello, {event.from_user.get_mention(as_html=True)} 👋!",
parse_mode=types.ParseMode.HTML,
)
async def main():
bot = Bot(token=BOT-TOKEN)
try:
disp = Dispatcher(bot=bot)
disp.register_message_handler(start_handler, commands={"start", "restart"})
await disp.start_polling()
finally:
await bot.close()
asyncio.run(main())
Moar!
You can find more examples in examples/ directory
Official aiogram resources:
- News: @aiogram_live
- Community: @aiogram
- Russian community: @aiogram_ru
- PyPI: aiogram
- Documentation: aiogram site
- Source: Github repo
- Issues/Bug tracker: Github issues tracker
- Test bot: @aiogram_bot
Contributors
Code Contributors
This project exists thanks to all the people who contribute. [Code of conduct].
Financial Contributors
Become a financial contributor and help us sustain our community. [Contribute]
Individuals
Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]