I have this func:
@dp.message_handler(state=StateInfo.user_answer)
async def reset_bot(message: types.Message, state: FSMContext):
await state.reset_state(True)
if message.text == 'Send new task':
await start_uma(message)
else:
…
I'm trying to deploy my Telegram Bot on hosting. The bot was written in python, aiogram.
Firstly, for a test I tried to deploy simple echo bot.
According to aiogram docs:
WEBHOOK_HOST = 'https://your.domain' # Here I entered my…
I'm developing a telegram bot. So i have three tables in my database:
Users - stores information about users. fields:
user: stores user's telegram id. it needs to assign a record to the user
first name, last name, etc
Notes - stores user's notes.…
Im trying to get a random number while clicking inline buttons. Im getting a message with buttons, but when i click on them nothing happends — i just see a small clock in the button. Here are my handlers:
from loader import dp
from random import…
I use aiogram. Logic of my bot is very simple - he receive messages from user and send echo-message after 10 seconds. This is a test bot, but in general, I want to make a bot for buying movies with very big database of users. So, my bot must be able…
How do I convert int to BigInteger in Python?
I can't find anything like this on the net for python. I need to convert int to BigInteger in order to compare via Sqlalchemy ORM with the value in the database (telegram_id are registered via models…
I have an id from a group chat, but when I try to send a message there, I get this error:
Traceback (most recent call last):
File "D:\github\repositories\python-bot\venv\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 415, in…
i dont known, pls help
async def getcatalog(message: types.message):
if catalog.find_one({"type": 0}) is None:
await message.answer('К сожалению, товаров нет в наличии')
else:
inline_kb = types.InlineKeyboardMarkup()
…
I wrote this code and I need to get "local time" from user's message (string type).
But I need this like integer to set timer.
There is TypeError in
"local_time = int(msg.from_user.id, msg.text)"
How can I fix it?
from aiogram import…
models.py
from django.db import models
class Post(models.Model):
text = models.TextField()
approved = models.BooleanField(default=False)
group = models.ForeignKey('bot_users.BotUserGroup', on_delete=models.SET_NULL, null=True,…
I don't understand what is my mistake.
Can someone show me the correct code
My code:
@dp.message_handler(content_types=['text'])
async def Text(update):
dl = downloader.tiktok_downloader()
global last_use
meseg = update.message.text
…
Hello everyone I wrote a bot for a freelance tutorial order, the bot responds to messages, but there is a problem with payment, after entering the amount of replenishment, the bot does not respond, maybe I made a mistake somewhere?
main.py code
…
I wrote a bot on aiogram, but it doesn't work the way I need it to. It does not save data to the database from time to time. Checked by the sqlite studio utility. after I wrote the algorithm I confirm it db.commit(), but the data is somehow not…
I am writing a telegram bot using aiogram. The bot will be used by a lot of people and the bot has an order module.
The task of this module is to create orders that must be closed on time.
For example, the bot requests the date and time the order…