TeleGenesys.py 文件源码

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

项目:Tele_Genesys 作者: mthbernardes 项目源码 文件源码
def handle_message(msg):
    user_id = msg['from']['id']
    nome = msg['from']['first_name']
    try:
        sobrenome = msg['from']['last_name']
    except:
        sobrenome = ''
    username = msg['from']['username']
    hostname = subprocess.check_output(['hostname']).lower()
    content_type, chat_type, chat_id = telepot.glance(msg)
    if username in admins:
        if content_type is 'document':
            bot.downloadFile(msg['document']['file_id'], msg['document']['file_name'])

        elif content_type is 'text':
            command = msg['text'].lower()
            actions(user_id,command,hostname)
    else:
        bot.sendMessage(user_id, 'Desculpe '+nome+' '+sobrenome+' nao tenho permissao para falar com voce!')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号