bot.py 文件源码

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

项目:JackOfAllGroups-telegram-bot 作者: Kyraminol 项目源码 文件源码
def send_media(bot, chat_id, media_type, media_id, text, reply_to_id=None):
    if media_type == "audio":
        bot.send_audio(chat_id=chat_id, audio=media_id, reply_to_message_id=reply_to_id)
    elif media_type == "document":
        bot.send_document(chat_id=chat_id, document=media_id, caption=text, reply_to_message_id=reply_to_id)
    elif media_type == "photo":
        bot.send_photo(chat_id=chat_id, photo=media_id, caption=text, reply_to_message_id=reply_to_id)
    elif media_type == "sticker":
        bot.send_sticker(chat_id=chat_id, sticker=media_id, reply_to_message_id=reply_to_id)
    elif media_type == "video":
        bot.send_video(chat_id=chat_id, video=media_id, caption=text, reply_to_message_id=reply_to_id)
    elif media_type == "voice":
        bot.send_voice(chat_id=chat_id, voice=media_id, reply_to_message_id=reply_to_id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号