Python 程序输入文件

Python 程序输入文件,python,input,bots,telegram,telegram-bot,Python,Input,Bots,Telegram,Telegram Bot,代码: 错误: From handlers import TOKEN from aiogram import Bot, Dispatcher, executor, types from aiogram.types import InputFile bot = Bot(token=TOKEN) dp = Dispatcher(bot) music = InputFile(r'C:\Users\Acer\Desktop\файлы для примера\Apple-tv-iso-b-01-to

代码:

错误:

From handlers import TOKEN
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types import InputFile

bot = Bot(token=TOKEN)
dp = Dispatcher(bot)

music = InputFile(r'C:\Users\Acer\Desktop\файлы для примера\Apple-tv-iso-b-01-top.jpg')

@dp.message_handler(commands=['Start'])
async def process_hello(message: types.File):
await bot.send_file(message.from_user.id, music)

if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True)
从未检索到任务异常 未来: 回溯(最近一次呼叫最后一次): (系统错误) 文件“C:\Users\Acer\Desktop\python\ббббббббббббббб107 等待bot.send_文件(message.from_user.id,音乐) TypeError:send_file()缺少2个必需的位置参数:“file”和“payload”
Task exception was never retrieved
future: <Task finished name='Task-9' coro=<Dispatcher._process_polling_updates() done, defined at C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\dispatcher.py:409> exception=TypeError("send_file() missing 2 required positional arguments: 'file' and 'payload'")>
Traceback (most recent call last):
(sistem errors)
  File "C:\Users\Acer\Desktop\python\боты телеграмм\3\menu.py", line 12, in process_hello
    await bot.send_file(message.from_user.id, music)
TypeError: send_file() missing 2 required positional arguments: 'file' and 'payload'