def handle(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
input_text = msg['text']
flavor = telepot.flavor(msg)
summary = telepot.glance(msg, flavor=flavor)
print(flavor, summary)
if input_text.startswith("https://"):
cmd = 'youtube-dl --extract-audio --audio-format mp3 \
--output "audio.%%(ext)s" %summary'%(input_text)
os.system(cmd)
sendAudio(chat_id,'audio.mp3')
else:
bot.sendMessage(chat_id,input_text)
评论列表
文章目录