New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/start doesn't work #1452
Comments
As I figured out, it doesn't get messages from second account. But if I turn my script off, getUpdate (https://api.telegram.org/bot'token'/getUpdates) get all the messages I send to the bot:
|
Looks like a non-aiogram issue. Debug your application or send minimal reproducible example |
Have some problem now. Bot can send messages, but not handling any commands |
@Petrprogs, still need minimal reproducible example |
This was problem in my code: import asyncio
from aiogram import Bot, Dispatcher, types, F
from aiogram.filters import Command
bot = Bot(token=TG_TOKEN)
dp = Dispatcher()
@dp.message(Command("start"))
async def send_welcome(msg):
await msg.reply("Hi there!")
async def main_loop():
while True:
print("Some infinty loop")
await asyncio.sleep(10)
asyncio.run(main_loop())
asyncio.run(dp.start_polling(bot)) # This won't run, because main_loop() has infinity while loop To solve this a just moved import asyncio
from aiogram import Bot, Dispatcher, types, F
from aiogram.filters import Command
bot = Bot(token=TG_TOKEN)
dp = Dispatcher()
@dp.message(Command("start"))
async def send_welcome(msg):
await msg.reply("Hi there!")
async def main_loop():
asyncio.create_task(dp.start_polling(bot))
while True:
print("Some infinty loop")
await asyncio.sleep(10)
asyncio.run(main_loop()) Sorry for my weird code :) |
Checklist
Operating system
Ubuntu 22.4
Python version
3.8
aiogram version
2.21
Expected behavior
Bots responds
Current behavior
/start
doesn't work for the bot I made with aiogram. But for all other users it works perfectly. What could be a problem?Steps to reproduce
Code example
No response
Logs
No logs from bot as it doesn't respond to my account
Additional information
No response
The text was updated successfully, but these errors were encountered: