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!')
评论列表
文章目录