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

ChatMemberUpdated and ChatInviteLink, does not remove restrictions?

Please tell me there is a code invite_link = await bot.create_chat_invite_link(update.chat.id) creates, for everyone, a permanent invitation link, it is necessary that the user shares the invitation link and only then, as he subscribes, a new…
Miki
  • 1
  • 1
0
votes
0 answers

502 Bad Gateaway with aiogram webhooks

I am new to telegram bots developing, currently I am trying to make bot using aiogram and webhooks. Here my configuraton of domain: server { server_name my_server my_server; add_header Access-Control-Allow-Origin *; add_header…
Vivern202
  • 29
  • 3
  • 7
0
votes
0 answers

aiogram: how to connect an inline keyboard from a function of another file with a bot file if this function will work in another code

Project (connection between DRF and bot with endpoints): -bot-directory (not in django project) : services.py and main.py in it -folders of django apps, manage.py etc. My function from services.py from bot directory def get_items_kb(): keyboard…
0
votes
0 answers

Problem with local module detection. python aiogram

I have this project structure: project-root │ ├── bot/ │ ├── __init__.py │ └── main.py │ └── venv/ ├── run.py init.py initializes the main.py file, but the run.py file does not see it and returns me following error: Traceback (most recent…
sadylodr
  • 1
  • 2
0
votes
0 answers

How can I send a message in telegram with APScheduler and Aiogram

I've tried to do this: sched = AsyncIOScheduler(timezone='Europe/Moscow') sched.add_jobstore(SQLAlchemyJobStore(url='sqlite:///ProjectDB.sqlite')) sched.add_job(create_note, 'interval', seconds=5, kwargs={'bot': bot, 'id':id}) with function: async…
PR. OR
  • 1
  • 2
0
votes
0 answers

TypeError: cannot pickle 'weakref.ReferenceType' object

I've tried to shedule 2 jobs: scheduler.add_job(send_delayed_message, 'date', run_date=datetime.now() + timedelta(minutes=1), kwargs={'id': order['ID'], 'bot': bot}, id=f'{order["ID"]}_first') scheduler.add_job(send_delayed_message, 'date',…
PR. OR
  • 1
  • 2
0
votes
0 answers

How to call a regular function in a callback handler

How to call a regular function in a callback handler there is a menu function: async def menu(message: types.Message): user_stat = db.get_user_stat(message.from_user.id) await message.answer(f"Your ID: {user_stat[0]} Name:…
0
votes
2 answers

Aiogram builtin IDFilter doesn't work with updating values

I need to check if a message sender is in a "special" list, to allow only special users to use some commands. I used IDFilter for it. But this "special" list may be changed, and I need these changes to be taken into account. But I found that…
TimKostenok
  • 52
  • 11
0
votes
0 answers

Unable to Edit Messages - MessageCantBeEdited Error in aiogram

i was making a gpt 3.5 integrated telegram bot and i wanted to edit texts with bot. I had tried for a long and it worked once. But it's not working now. @dp.message_handler() async def echo_msg(message: types.Message): await message.reply("Hi") …
0
votes
1 answer

Why echo bot with message.send_copy() doesn't react on photos?

I was writing a Telegram bot noticed that it doesn't respond to photos. This echo bot should copy every message (other than /start) and sendit back using message.send_copy(message.from_id). It works on simple text messages, but if I send a photo to…
TimKostenok
  • 52
  • 11
0
votes
0 answers

Combining Two Telegram Bots in One Project using aiogram (Python) with Webhooks

I'm developing a Telegram bot for a store using the aiogram library in Python. My project requires two bots, namely the store bot and the courier-delivery bot for the store, to work together in the same application. I've tried various approaches,…
0
votes
0 answers

Error in Aiogram indicates "AttributeError: the 'Dispatcher' object does not have the 'answer' attribute" why?

The code of the bot that responds to new vacancies on the site. I used the asynchronous version of schedule - aioschedule so that the function action was repeated every 3 minutes. However, after the first execution, an error occurs "AttributeError:…
0
votes
0 answers

why the keyboard in the bot are not working?

The bot sends me a screenshot message with promo code activation, and 4 buttons are created under the message, namely 1-4, and each button executes its own script in Chromium, but for some reason the buttons are not working from…
0
votes
0 answers

Selenium is not finding neccessary element on the page while working on vps server

I have the selenium parser, which clearly works on my own computer with no exceptions. However when im trying run it on my vps server i got the NoSuchElementException. Here is my code and the text of the problem: def csgo_registration(): …
0
votes
1 answer

aiogram bot stands during function

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…