11 Nov 2023, 14:33 UTC≈1,050 views38 reactionsread 8 August 2026 ❔ How to use MagicFilter?
———————————————————
documentation: click
1) Use necessary attribute. Examples:
• Message.from_user.id -> F.from_user.id
• CallbackQuery.data -> F.data
2) Use it. Examples (with type Message):
• video isn't null
F.video
• text equal "hello"
F.text == "hello"
• users are my friend and me
F.from_user.id.in_([123, 456])
• text contains "run"
F.text.contains("run")
• custom func
F.text.func(lam…
🔥15🤡7👍5💩3🤮3❤2🐳1👏1
7 Sept 2023, 15:05 UTC≈1,090 views11 reactionsread 8 August 2026 ❔ How to use custom emoji?
———————————————————
Buy username on Fragment and use tg-emoji tag.
..More
..Very expensive wish(5000 TON)
🥰4😁4🤡2🔥1
1 Sept 2023, 06:35 UTC≈1,110 views3 reactionsread 8 August 2026 ❔ How to mimic bot actions?
———————————————————
from aiogram import Bot, Router
from aiogram.types import Message
from aiogram.enums import ChatAction
from aiogram.utils.chat_action import ChatActionSender
router = Router()
@router.<update>()
async def func(msg: Message, bot: Bot):
await bot.send_chat_action(msg.chat.id, ChatAction.RECORD_VOICE)
# or with context manager
async with ChatActionSender(bot…
👍2😍1
25 Aug 2023, 08:06 UTC≈1,050 views8 reactionsread 8 August 2026 ❔ How to set state for any user?
———————————————————
from aiogram import Bot, Router
from aiogram.fsm.context import FSMContext
from aiogram.fsm.storage.base import StorageKey
router = Router()
@router.<update>()
async def func(..., state: FSMContext, bot: Bot):
storage = state.storage
user_id, new_state = 1234567890, ...
await storage.set_state(StorageKey(bot.id, user_id, user_id), new_state)
❤4👎2👍1🤯1
4 Jul 2023, 14:21 UTC≈1,320 views20 reactionsread 8 August 2026 ❔How to use fluentogram?
——————————————
On Github
Official repo
Group: @fluentogram
Good structure for translations:
translations
'- {locale}
'- main.ftl
Middleware example:
class TranslatorRunnerMiddleware(BaseMiddleware):
async def call(self, handler: callable, event: Message, data: dict) -> None:
language = "en" # get from db or from event: event.from_user.language_code
data['i18n'] = dat…
🔥9🤮5👎2💩2👍1🤣1
2 Jul 2023, 20:19 UTC991 views13 reactionsread 8 August 2026 ❔How to skip bot updates?
——————————————
from aiogram import Bot
async def main() -> None:
bot = Bot(...)
...
await bot.delete_webhook(drop_pending_updates=True)
👍6🗿4🆒2🤡1
28 Jun 2023, 11:13 UTC≈1,160 views21 reactionsread 8 August 2026 ❔How to check a channel subscription?
————————————————————
On Github: click
Filter example:
class SubChecker(BaseFilter):
async def __call__(self, msg: Message, bot: Bot) -> bool:
sub = await check_sub(bot, settings.CHANNEL_ID, msg.from_user.id)
if sub:
return True
await msg.answer("You aren't subscribed to the channel!")
return False
Subscription checking example:
asy…
👍17👎3👏1
23 Jun 2023, 16:19 UTC≈1,110 views11 reactionsread 8 August 2026 📍 You can share your code on:
• pastebin.com
• gist.github.com
• paste.aiogram.dev
• dpaste.org
• nekobin.com
• hastebin.com
👍9❤🔥2
21 Jun 2023, 18:08 UTC≈1,060 views23 reactionsread 8 August 2026 Photo
#for_important_conversations
🔥15😁5❤1❤🔥1👍1
21 Jun 2023, 07:57 UTC≈1,170 views14 reactionsread 8 August 2026 ❔ How to get bot instance in handler?
———————————————————
from aiogram import Bot, Router
router = Router()
@router.<update>()
async def func(..., bot: Bot) -> None:
await bot.send_message(...)
👍8🤣4❤🔥1👾1
3 Jun 2023, 14:12 UTC≈1,650 views9 reactionsread 8 August 2026 HTML TAGS
—————
Documentation: click
———
• <b>bold</b>
=> bold
———
• <i>italic</i>
=> italic
———
• <u>underline</u>
=> underline
———
• <s>strikethrough</s>
=> strikethrough
———
• <tg-spoiler>spoiler</tg-spoiler>
=> spoiler
———
• <a href="aiogram.dev">aiogram</a>
=> aiogram
———
• <code>code block</code>
=> code block
———
..all this work with parse_mode="html"
..all links: click
👍7❤🔥2
30 May 2023, 20:33 UTC≈1,750 views11 reactionsread 8 August 2026 LINKS
—————
• Main
Bot API: click
documentation: click
book: click
———
• Mediagroups
pyrogram & middlewares: click1 & click2
middlewares: click1 & click2
simple: click
———
• Middlewares
throttling: click1 & click2
———
• Examples
aiogram & sqlalchemy: click
local server: click
payments: click
———
• Templates
Bomzheg: click
Forden: click
Trafi713 (with fastapi): click
———
• Posts
html tags: click
bot instance: click
ai…
👍9❤🔥2
Showing the 12 most recent of 13 posts we hold for @aiogram_useful. View and reaction counts are the latest single reading for each post, not a live figure, and a recent post is still accumulating both. A view count marked ≈ was rounded by Telegram before we ever saw it — t.me prints views in full below 1,000 and to three significant figures above, so ≈1,200,000 means somewhere between 1,150,000 and 1,249,999. Unmarked counts are exact. Text is reproduced from the public post preview and truncated for length.