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…
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 =…
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():
…
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…
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…
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
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…
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:…
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…
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…
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?
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…
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…
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…