Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I can’t get the user id

I was writing a bot and I was dealing with this problem.
Who knows how to fix it?

enter image description here

from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.types import message
from aiogram.utils import executor

import os


bot = Bot(token=os.getenv('TOKEN'))
dp = Dispatcher(bot)

#clien
@dp.message_handler(commands = ['start', 'help'])
async def commands_start(massage : types.message):
    await bot.send_message(message.from_user.id, "Hello, who are you?")





executor.start_polling(dp, skip_updates=True)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

async def commands_start(massage : types.message): seems to use "massage" instead of "message", try fixing that and see if it works

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading