I'm researching aiogram module for Telegram bots. Handlers for messages from Telegram are decorated with @dp..... wrappers where dp = Dispatcher(). All examples in docs are about one file code. So, it works as follows:
...
dp =…
i don't understand but if i run the jar file and it prints the initial logs, all the handlers stop working
handlers are still working until all the initial logs come to me in tg
async def main():
server_path = '../servers_community/cree'
…
Writing a bot for tech support.When I send a question, the bot forwards it to the channel and starts forwarding it too. And so it goes on endlessly.
Example(User-user who sent the bot a question, Bot1-bot who answers the user, Bot2-bot who writes in…
elif message.text == "awf":
message = await bot.send_message(message.chat.id, "wegw4")
await dp.register_next_step_handler(message, start_2)
I just started studying aiogram today, so I can't even suggest how to solve this problem
For the sake of studying the capabilities of the Telegram API, the question arose, how to get the @username of a bot in a telegram using aiogram?
I tried username = bot.get_me().username but gives the following error:
AttributeError: 'coroutine'…
We wrote a bot on Windows, everything works fine, put it on the mac, gives an error connecting to the host, we do not understand what is the matter. I attach the text of the program below. Screenshots with errors too.
import re
import os
import…
When I run docker-compose.yml on windows, an error comes up, even though everything in the code is correct.
With packages exactly no errors, all checked 2 times, perhaps the problem with the imports, which begin with a dot, but then how to replace…
Can't implement translation of messages to other languages with i18n on aiogram 2.25
The whole bot works, only without translation, but in the usual language.
Here is a link to the repository, maybe someone can help, I've been sitting on this for a…
He must reply to all messages in private, but in the group he must reply to messages in which he is mentioned and ignore all others. But for some reason it doesn't work and he still replies to all messages.
Here is my code:
import openai
import…
I have developed a telegram bot on Python using Aiogram 2.3 that offers user to play "Truth or Dare" game. Bot works pretty good with one user, but when 2+ users start using bot in the same time, global variables, states, localisation becomes a…
My code worked and send messages to all users, but when i send message with font or in text links, aiogram fsm machine don't seen that. What i need to do?
import logging
from aiogram import Bot, Dispatcher, executor, types
from…
Aiogram. Im getting a "message" is not defined error, and I understand why, but when I add message: types.Message to my func args it now needs 2 arguments but my func inly gets one, so what do i do?
@dp.callback_query_handler()
async def…
I want the bot to play the role of someone. every time the user sends messages, they will be saved and the bot will know the context. But an error occurs:
prompt = reply_to_message.text
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no…
I'm writing a tg bot. I need to save user's photo to the database. I use this code:
def parse_photo(file_path: str):
with urllib.request.urlopen(f"https://api.telegram.org/file/bot{os.getenv('TOKEN')}/{file_path}") as f:
html = f.read()
…