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

the bot stops and does not respond

I wrote a bot to get photo charts in tradingview: from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters.state import State, StatesGroup import sellbot from aiogram.contrib.fsm_storage.memory import MemoryStorage from aiogram…
Artik gnom
  • 25
  • 1
  • 7
0
votes
0 answers

How to send a base64 image using aiogram?

I need to send an image to the user that is encoded in base64. I am new to aiogram and python.media = types.InputMediaPhoto("base64://"+photo, caption=caption)#This bullshit doesn't work. Is there a way to bypass saving as jpeg?
0
votes
0 answers

Aiogram Webhook start_webhook() not working in async

The code is completely copied from the documentation. https://docs.aiogram.dev/en/latest/examples/webhook_example.html All requests go sequentially, checked with asyncio.sleep() Operating System: Python Version: 3.10.2 aiogram version:…
Maiddragon
  • 19
  • 1
  • 4
0
votes
1 answer

aiogram How to replace a file that has already been uploaded by the user

My problem is as follows: The user uploads a file, after which the file successfully gets into the folder, then the user uploads a file with the same name, but with a different content. My program offers him options to replace the file with a new…
0
votes
0 answers

Unable to work with aiogram package in Python

I am trying to install the aiogram package with Poetry, but I am getting the following error: [tool.poetry.dependencies] python = "3.9" aiogram = {url = "https://github.com/aiogram/aiogram/archive/refs/heads/dev-3.x.zip"} I have also tried to…
0
votes
1 answer

Function works fine when called manually, but crashes, when called using a scheduler

I have a function to send a certain message to all telegram bot(set up through aiogram) users, but for some reason it works only half of the times. async def send_text(): try: users = getusers('./database/users.db', "bot_users") …
0
votes
0 answers

Telegram WEB APP (using aiogram) replaces the https protocol with http

Here is a piece of code keyboard = ReplyKeyboardMarkup(resize_keyboard=True) token_api = create_token_api(id) web_app_url = Web App Info(url=f"https://?telebot=true&token={token_api}") keyboard.add(Keyboard Button(text="test",…
Andrey
  • 1
0
votes
1 answer

PostgreSQL error Connection refused (0x0000274D/10061)

Trying to launch telegram bot (aiogram) and connected DB on PostgreSQL psycopg2.OperationalError: connection to server at "127.0.0.1", port 5432 failed: Connection refused (0x0000274D/10061) Is the server running on that host and accepting…
Dired
  • 17
0
votes
0 answers

TelegramBadRequest aiogram lib when trying to send photo to telegram bot

In general, I recently found api for rule34. I want to make the integration of photos into the bot from there. Starts looking for a photo, and sometimes an error pops up: aiogram.exceptions.TelegramBadRequest: aiogram.exceptions.TelegramBadRequest:…
0
votes
0 answers

Interval mailing aiogram 3.0.0b7

async def periodic(sleep_for): while True: await sleep(sleep_for) if db.mailing_state() == 'on': logger.info('Сделали рассылку') post = db.get_post(randint(0, len(db.get_keys_posts()))) for…
freezy
  • 1
  • 1
0
votes
0 answers

Telegram bot forwarding a user's message to a group and sending responses from it?

Good afternoon everyone! Recently I started getting acquainted with writing bots for telegrams, I just can’t figure out how to make the bot redirect the user’s message to a specific group, and from there send all the answers back to the chat. I saw…
0
votes
0 answers

I can not get to the next state function in aiogram

So I am making a Telegram bot and trying to get a phone number from a phone number provider through API and my one of the command is: These are the states: class States(StatesGroup): MIKTAR = State() ONAY_KODU = State() KULLANICI_ID_AL =…
0
votes
0 answers

How to get information about a chat bot in aiogram 3.0

I need to check the bot for administrator rights The library has the get_chat_member method. However, when I try to call it and pass the parameters of the ID chat and the user, I get the error 'module' object is not callable. I have no way to call…
0
votes
0 answers

how can i run async function from another thread

I am using aiogram to manage my telegram bot, the function of the bot is simple: it listens on a tcp connection port and posts the received string into my telegram group. so far the bot on itself works perfectly and the socket server receives the…
0
votes
1 answer

Inline button that allows you to redirect the user to the chat room

enter image description here enter image description here I searched for information on google and asked AI, but could not find the right answer After clicking on the inline button, a window appears selecting chats, after selecting the bot is added…
freezy
  • 1
  • 1