I have a Telegram Bot on aiogram, and I want to be notified when my bot is added or removed from channels.
But my code only works on groups.
What needs to be done to work on channels as well?
And here is the code:
import logging
from aiogram import…
How can I do this: I got my tgbot using aiogram and I need this bot to handle replied messages. For example: A user in chat replied some message and the bot should handle the users message and also the message that user replied.
I've…
I want my bot to reply to a certain person in chat every time he writes (in fact every 2 hrs, like regular cuddling)
e.g.
User1: Good morning everyone
User2: Good morning
Bot: (reply to User2): Have a nice day!
Now i can send messages to group…
I am learning aiogram, and trying to get some messages as args for funtion call. As I learned from internet I should use State Machine
First I ask for some args and change state, to catch next message
@dp.message_handler(text='Parse',…
I'm creating a bot that sends math problems in image format. I wanted to create two two functions for different commands, so that one command only sends one genre of question, while the other sends another genre. Example: /random sends general…
I working on python telegram bot that allow login telegram client using registered user and then do some actions using user credentials ...
... But I got the following error:
ERROR: The confirmation code has expired (caused by SignInRequest)
I use…
You need to send separate messages schedule for different days.
Here is an example input:
raspisanie = [{'week_day': 'Monday, 'name': 'Lesson 1', 'time': '8:30'}, {'week_day': 'Tuesday', name: 'Lesson 1', 'time': '8:30'}, {'week_day': 'Tuesday',…
How I can fix it? I played with it a lot and for a long time, but nothing came of it.
sql_db.py:
import asyncio
import asyncpg
LOG_PG = {"database": 'test_bot',
"user": 'misha',
"password": '1234',
"host":…
I am developing a telegram bot using Python 3.9.7 and aiogram 2.16, at the end of my function I want to reset the user's state without deleting the stored data.
I tried using state.finish() but this method removes all saved data from storage
Here's…
I have got a Telegram-bot in AIOgram. My aim in this bot is to run it and if user writes secret phrase - bot must send secret message.
My code in main.py file:
from aiogram.dispatcher.filters import Text
from aiogram.dispatcher import…
I am creating a telegram bot in python using aiogram. I want to prescribe a condition under which the bot will reboot. Tell me how to implement using the code to restart the bot on aiogram? Thank you in advance for your help!
The bot works on a VPS…
I want to add a function to the bot "change chat permissions" and I can't figure out how to do it.
Using an aiogram lib with postgresql database (psycopg2)
Python 3.9.5
aiogram==2.14.3
Callback handler (for example: call.data =…
Are there ways for an aiogram bot to request a user action which would send user's location to the bot? User action could be for instance:
InlineKeyboardButton, or
ReplyKeyboardButton.
Thanks!
I tried to do a shopping cart in the telegram bot using psycopg2 and aiogram, but the data does not appear in the "korzina" column
code:
connection.cursor(f'INSERT INTO bot_users(korzina) VALUES({id_tovara}) FROM bot_user WHERE user_id= …