gpt4 book ai didi

python - 如何让机器人回复音频消息?

转载 作者:行者123 更新时间:2023-12-04 17:11:26 25 4
gpt4 key购买 nike

如何让 aiogram bot 回复音频消息?我已经试过了:

if message.Audio.duration <= 60:
await message.reply("message")

最佳答案

@dp.message_handler(content_types=types.ContentTypes.VOICE | types.ContentTypes.AUDIO)
async def audio_message_handler(msg: types.Message):
if msg.content_type == "voice":
await msg.reply("Voice message")
elif msg.content_type == "audio":
await msg.reply("Audio message")

关于python - 如何让机器人回复音频消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69338520/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com