我无法获取用户 ID
I can’t get the user id
我正在写一个机器人,我正在处理这个问题。
谁知道怎么解决?
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)
async def commands_start(massage : types.message):
似乎使用了“massage”而不是“message”,请尝试修复它并查看它是否有效
我正在写一个机器人,我正在处理这个问题。 谁知道怎么解决?
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)
async def commands_start(massage : types.message):
似乎使用了“massage”而不是“message”,请尝试修复它并查看它是否有效