main.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:telegram-bot 作者: botshala 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号