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 asynchronous framework for Telegram Bot API based on client.

Resources

Related Tags

430 questions
0
votes
1 answer

Timeout context manager should be used inside a task, nothing wrong to be seen

So, I'm building a pretty sizeable bot and I've ran into a problem: for some reason in a very specific part of my code I just can't run a coroutine. I am getting the error when I call bot.send_message. I've already tried creating tasks, new threads,…
TheAIguy_
  • 3
  • 2
0
votes
0 answers

Telegram timeout

using aiogram 3 i try to download sond for 1hr+. download is good, but sending via telegram so week.. @router.message(Command(commands=['youtube'])) async def music_download(message: types.Message): try: text =…
0
votes
0 answers

Double-answer from aiogram + telethon

I have two scripts, which are written on telethon and aiogram. My telethon scripts resend massages from the groups and aiogram process them (will be completed later). Unfortunately, when both of scripts are executing simultaneously, that cause…
0
votes
1 answer

Telethon splits the group of photos

When my bot try to resend a group of photos, it splits it into separate messages. If it is a group of photos (in Telegram), I need to resend it wholly, as a group within one message. How to fix it? from telethon import TelegramClient, events import…
0
votes
1 answer

How do I return to a previous state in aiogram FSM when using 'Back' button?

How to make Return buttons in aiogram with FSM class AdminConsole(StatesGroup): menuEntry = State() menuChoice = State() choosenStudent = State() Saction = State() newName = State() newID = State() rmConfirmation =…
0
votes
0 answers

What needs to be changed to make the restriction in the bot work?

In theory, the user should send a screenshot and he was limited to one screenshot until it is not approved for subsequent submissions by the owner of the bot, but why does not appear after the command list of users in which this restriction and with…
0
votes
0 answers

My Telegram bot throws an error when working with my model

I was able to connect a model trained on Catboost with my bot, but when I enter data for analysis, an error pops up. raise CatBoostError("Invalid {}[{}] = {} value: index must be < {}.".format(features_name, indx, feature, features_count))…
0
votes
1 answer

How to implement a share profile button in aiogram like PremiumBot?

How to implement a share profile button in aiogram like PremiumBot? Im not sure if it is even possible because i didnt found any info about it in official documentation Create share profile button like in PremiumBot (I attached photo) enter image…
Ewtizzz
  • 5
  • 2
0
votes
0 answers

is there a way to stop or finish the awaiting

it keeps on awaiting for a username or link in every message I send. @dp.message_handler(commands="posts") async def cmd_stat(message: types.Message): await message.answer("Input a username or else send profile link") @dp.message_handler() …
0
votes
0 answers

Problems with displaying images through the aiogram library

@dp.message_handler(content_types=types.ContentTypes.PHOTO,state=CREATEPOSTFSM.Photo_state) async def process_photos_step(message: Message, state: FSMContext): photos: List[types.PhotoSize] = message.photo await…
Danila
  • 1
  • 1
0
votes
1 answer

Having some issues with python bot

So I was making a python bot, that sends results of it's work to Telegram. it was working until yesterday. Now when im starting it it returns this error: File "E:\FindBot\handlers\users\start.py", line 4, in from loader import dp File…
Pudge
  • 1
  • 1
0
votes
0 answers

aiogram event handling not working dispatcher

I am trying to get updates: dp = Dispatcher() @dp.update() async def message_handler(update: types.Update): print(update) But it doesn't work and nothing is output to the console I need to intercept any events and make it so that other…
0
votes
1 answer

How to run aiogram bot and pyrogram app together (these two modules)?

I wrote a function on pyrogram that parses the history of a chat. The history is filtered by participant id, if a specific user wrote to the chat, the message will be forwarded to me. (We need to know: the name of the group, the id of the…
0
votes
1 answer

How make command usable in aiogram?

I try to make command usable after entering password, please help. This command doesnt work after password. from aiogram import Bot, Dispatcher, executor, types from aiogram.contrib.fsm_storage.memory import MemoryStorage from aiogram.dispatcher…
0
votes
1 answer

How do I make an inline picture button using python aiogram

I tried a few things but while I'm able to display an inline button, I'm unable to get a picture button with a local icon stored in a folder within the script directory. Any advice? I've tried import io import os import logging from aiogram import…
user18767111