friendly split space debug message fix command bug

This commit is contained in:
2017-08-23 17:59:10 +08:00
parent 62e0973ead
commit 91afc539f7

3
bot.py
View File

@ -22,6 +22,7 @@ def on_chat(msg):
print('chat_type:', chat_type) # for debug
print('chat_id:', chat_id) # for debug
print('from_id:', from_id) # for debug
print() # for debug
# create a user object
user = kuser(from_id, bot)
@ -35,7 +36,7 @@ def on_chat(msg):
command = [msg['text']]
if msg['text'][0] == '/':
command = msg['text'].replace('_', ' ').lower().split(' ')
command = command.replace(config.NAME, '')
command[0] = command[0].replace(config.NAME, '')
# first-time user
if user.status == '第一次用' and chat_type == 'private':