How can I make it so that the administrator can indicate the reason for the ban and then the bot indicated this in the chat? Example: "!ban @NAMEorID Spam" From bot to chat: "User NAME banned. Reason -…
Update:
After few uncessful attempts to explain the problem, completely rewrote the question:
How to execute a function on startup?
from aiogram import Bot, Dispatcher, executor, types
API_TOKEN = 'API'
bot = Bot(token=API_TOKEN)
dp =…
I have started a simple bot with two message handlers, one of them is echo function and second one to respond for a command, just to check how it is working in pythonanywhere. Everything is working fine, but after I have run my script I tried to…
Using python3 aiogram library for a telegram bot. Is there a way to remove the messages from console generated by the executor? messages like Goodbye! or Updates were skipped successfully. if you start polling using skip_updates=True
My bot has on…
I'm working on creating a welcome bot using the aiogram library to greet new members who join a group. However, I'm encountering an issue when the group has enabled the "Hide Members" setting. In this case, new members joining the group don't…
So, Im coding a telegram bot using aiogram. His job is to get the news from parser through function trans_news then process it through ChatGPT and then send the processed news to admins pm. Then admin can - delete, edit or post it. If button "post"…
i've faced with some problem in aiogram. And i have no idea what wrong with that code and what might be the reason of that problem.
My bot is asking for some question. Before asking it need to be sure, that user is now ready for that. After that he…
I trying to write a Telegram bot using AIOGRAM 3.7b.
There is a Problem occcurs with my code: RuntimeWarning: coroutine 'SyncToAsync.call' was never awaited
Code bellow:
parents_handler.py
@parents_router.message(ParentsState.main)
async def…
I have a button 'Send promocode' in my bot, when user clicks on these button i receive message in my admin channel,
@dp.message_handler(Text(equals="requset promo"))
async def get_promocode(message: types.Message):
id = message.from_user.id
…
I am writing a telegram bot, one of the functions of which is face recognition. The user sends a photo to the chat. Is it possible to send it as a file to the function parameter without saving the photo to the database?
I have a class…
Friends, I am learning to create simple bots. And I'm myself looking for a solution to problems on the Internet. But now I can not do without your experience and I hope for help! :)
Expected Result:
By the start command, we launch the bot.
A…
I make a ChatGPT bot in telegram, everything works fine. I decided to add the /image command, by which the user first select the size, quantity and then a request to the image, and Dall'e will generate an image.
I made the command, but the problem…
There are ≈ 2.5k archives of different size from 20kb to 2gb. They need to upload to telegram channel (not with links to other storages, clouds, etc.) Thought that it could be done through a bot (then I did not know about the 50mb limit).
Wrote the…
Using FSM's state.data in middlewares aiogram v3
How to use and work with user's state in middleware?
The main question is needed for checking user auth status.
Actual MRE
@menu.message(MenuFSM.menu)
async def show_menu(message: Message, state:…
Let's say I have this code in Aiogram. I need that when the @dp.message(Text('Begin ')) handler is run, only the handlers that are inside this handler are checked. And when the user wrote End , then the handlers in @dp.message(Text('Begin ')) were…