Questions tagged [aiogram]
aiogram is an asynchronous Python framework for Telegram Bot API. Use this tag when your question is related specifically to aiogram.
aiogram
524
questions
0
votes
0
answers
10
views
TypeError: BaseModel.__init__() takes 1 positional argument but 2 were given after using edit_media method in aiogram
I have a problem with using edit_media method in aiogram
code:
@router.callback_query(F.data == 'booking')
async def start_booking(callback: types.CallbackQuery):
await callback.message.edit_media(...
-6
votes
0
answers
24
views
Aigram delete messges [closed]
I am tormented by the question of deleting messages. He works terribly for me. Not all messages are deleted. Logically, there should always be 2 messages in the chat. Suggest an easy way, please!!!
...
0
votes
1
answer
27
views
Library version conflict python
I have two libraries, and both of them use typing-extensions, but they use different versions of typing-extensions. This conflict is causing an issue as both libraries are needed in one project. How ...
0
votes
0
answers
10
views
How to open "send this server message to my contacts" menu in telegram mini app
Good afternoon, i now working on telegram mini app project, and cant find way to open send message menu in that telegram app. User press button, then he see his contats, choose one and send to that ...
0
votes
0
answers
24
views
Forwarding messages from telegram web app
Good afternoon, now work on algorithm like
user press "invite friends" button in telegram web app, then he see list of his telegram contats and choose reciever of "forwarded" ...
-1
votes
0
answers
9
views
How to make sending picture to chat via via?
I wanted to make a similar @PostBot in TG, but I don't know what to use for it.
Here is an example of the bot https://t.me/PostBot, and you know if you enter in the input field tag @Gif it will show ...
0
votes
0
answers
25
views
aiogram 3.10 doesn't want to run my middleware
Wrote my first middleware to check if a user is logged in, the middleware doesn't want to work at all.
Python code:
class CheckUserExist(BaseMiddleware):
async def __call__(
self,
...
0
votes
0
answers
30
views
How to get bot's conversation history with user in aiogram?
I'm making a telegram bot using the aiogram (v3.9.0) library for python (v3.11) and I need to access some previous messages in a conversation with a user. Please note that we are not talking about a ...
0
votes
0
answers
25
views
How to Prevent Telegram Inline Keyboard Buttons from Collapsing in Aiogram 3
I'm developing a Telegram bot using Aiogram 3, and I'm facing an issue with inline keyboards. When the photo is narrow, the inline keyboard buttons collapse into three dots. I want to ensure that the ...
0
votes
0
answers
65
views
SELECT statement has a cartesian product between FROM element(s)
For my bot to rate a user's appearance in Aiogram 3 I tried to implement saving user ratings and for this I created a second model:
class Profile(Base):
__tablename__ = 'profile'
id_all: ...
0
votes
1
answer
45
views
aiogram download excel file to user as a file
I have a little project which is automate work task with telegram.
I use aiogram 3.5 version
I need upload excel file, which contains several sheets as a dict , sheet names as a dict keys, ...
0
votes
1
answer
50
views
Aiogram bot can't respond in Channel Comments
I wrote a simple aiogram chat-bot code, which can write down messages to mongodb database:
@router.message(Command('memorize'), IsChat(['group', 'supergroup', 'chat', 'channel']), IsAdmin(admin_id))
...
-1
votes
1
answer
37
views
Don't works Inline Button in scheduled message
im writing telegram bot on aiogram and have some function:
async def some_func():
err = InlineKeyboardMarkup(row_width=2)
btn_1 = InlineKeyboardButton(text='open_1', callback_data='number_1')
...
0
votes
2
answers
77
views
Comparing message text to gettext function result in Aiogram message handler
In my Aiogram router code I have several handlers that check the user's text against the buttons text translated by gettext module:
@router.message(F.text == gettext("Settings"))
async def ...
-1
votes
0
answers
216
views
file downloaded with aiogram download_file(), file cannot be found
i write a bot to decode qr-codes from user's message and send im data back. now i have an error
cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\objdetect\src\qrcode.cpp:32: ...