【发布时间】:2021-10-07 04:09:33
【问题描述】:
我正在尝试使用pyrogram 发送音频:
from pyrogram import Client as bot
await bot.send_audio(
chat_id=from_uid,
audio=path+'/'+file,
caption=f"`{file}`",
duration=duration,
reply_to_message_id=user_msg.message.reply_to_message.message_id,
# performer=response_json["uploader"],
# title=response_json["title"],
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton('⚙ Join Updates Channel ⚙', url='https://telegram.me/FayasNoushad')]]),
progress=progress_for_pyrogram,
progress_args=(
Translation.UPLOAD_START,
user_msg,
start_time
)
)
但是,我收到此错误:
TypeError: send_audio() missing 1 required positional argument: 'self'
【问题讨论】:
-
您需要实例化客户端。类本身不能用于向 API 发送请求。
标签: python python-3.x pyrogram