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
1
vote
0 answers

How create inline button which will allow you to add a this bot to the chat or channel in aiogram?

I want to make a button that will first show the user his chats and channels, and then, when selecting a chat or channel, offer to specify the rights of the bot, which will have the bot in the selected chat. I am using aiogram, but I have not found…
Mazikeen
  • 13
  • 3
1
vote
0 answers

How to trigger next state handler aiogram 3.0.0b

I have the following code (Aiogram 3.0.0b): from ..forms import * @router.message(Command(commands='register_journal')) async def initiate_register_journal_command(message: types.Message, state: FSMContext): current_user_id =…
Dimon Agon
  • 11
  • 4
1
vote
0 answers

Passing coroutines is forbidden, use tasks explicitly. Only raise on Apple M1

I have problem when try run simple async func in aioschedule and aiogram I use Apple M1 import aioschedule from aiogram import Bot, Dispatcher, executor, types TOKEN = 'token here' bot = Bot(TOKEN) dp = Dispatcher(bot) async def hello(): …
1
vote
0 answers

How to change state for the users with the user_id (with that error)

I found this code: state = dp.current_state(chat=chat_id, user=user_id) await state.set_state(User.accepted) But when I run it, I have that error: TypeError: Dispatcher.current_state() takes 1 positional argument but 2 were given It should work…
overl4mer
  • 11
  • 1
1
vote
2 answers

Echo bot on python not working without indicators and errors

import logging from aiogram import Bot, Dispatcher, executor, types API_TOKEN = '...' # Configure logging logging.basicConfig(level=logging.INFO) # Initialize bot and dispatcher bot = Bot(token=API_TOKEN) dp =…
Platon
  • 31
  • 2
1
vote
1 answer

callback data get string instead bool aiogram

Aiogram 2v. When i use callback data, instead bool i get string. How can i fix this in aiogram 2? I know how to do it in aiogram 3, but it beta. callback_data = faq_callback.new(action='faqAct' ,id=int(i.get('id')),iftext=bool(hastext))) But i…
bleb
  • 15
  • 3
1
vote
0 answers

How to build a telegram bot for esxi and is it possible?

I have a bot written in python, the customer wants to make ESXI out of it (to be honest, I never worked with this) Is it possible? I did not find information on the Internet
krausser
  • 11
  • 2
1
vote
0 answers

How to get telegram bot user ID, outside of function Aiogram

I know how to get the user ID in the usual way: async def start(message: types.Message): await bot.send_message(message.from_user.id, f'Here is your id {message.from_user.id}') But the question is, is it possible to find out the id outside of…
1
vote
0 answers

How to change image thumb in aiogram

The bot receives audio from the user and needs to convert the audio image and send it back to the user i got the id of the first audio @dp.message_handler(content_types=['audio'], state=None) async def get_music(message: types.Message, state:…
1
vote
1 answer

Changing the photo in the message by pressing the inline button Aiogram

The bot parses data from the site and writes everything to the list. I want to show the next photo from the above list every time I click "next" button. from aiogram import Bot, types from aiogram.dispatcher import Dispatcher from aiogram.utils…
1
vote
0 answers

how to work with aiogram photo without downloading it to disk

I want to get a photo of the qr code and decrypt it, but I don't want to save the qr code to disk, await message.photo[-1].download(destination_file = "aaa.png") can I somehow work with the resulting image without saving it? import cv2 from pyzbar…
1
vote
0 answers

How do I get update object in aiogram with message_handler decorator?

I can get message object via message_handler @dp.message_handler() async def kb_answer(message: types.Message): but I want update object also. How can I add update as parameter to get it in method?
rasputin
  • 380
  • 5
  • 22
1
vote
0 answers

Telegram bot authentication function

I am working on a Telegram bot (using aiogram package) and one of the requirements is to make user authentication. For example after /start command bot asks "Are you a client or an employee?" and employee has to send login and password to…
1
vote
0 answers

How do i keep my class variable exclusive for every user?

I'm trying to write a telegram bot, that selects a group of photos in 3 steps, using Inline Keyboards. During each of steps I call an Inline Keyboard with 2 buttons. First button selects a criteria, changes variable "selected_criteria" and calls…
Aomori 23
  • 13
  • 2
1
vote
1 answer

Message handlers aren't invoked in aiogram bot on webhooks

I'm launching an aiogram bot on webhooks locally using ngrok tunnel, but instead of proper responses, the bot returns 200 OK with almost nothing in response body, thus a user doesn't see anything in a chat. Bot's main.py driver looks like this: from…
acalabash
  • 33
  • 5
1 2
3
28 29