friendly split space debug message fix command bug
This commit is contained in:
3
bot.py
3
bot.py
@ -22,6 +22,7 @@ def on_chat(msg):
|
|||||||
print('chat_type:', chat_type) # for debug
|
print('chat_type:', chat_type) # for debug
|
||||||
print('chat_id:', chat_id) # for debug
|
print('chat_id:', chat_id) # for debug
|
||||||
print('from_id:', from_id) # for debug
|
print('from_id:', from_id) # for debug
|
||||||
|
print() # for debug
|
||||||
|
|
||||||
# create a user object
|
# create a user object
|
||||||
user = kuser(from_id, bot)
|
user = kuser(from_id, bot)
|
||||||
@ -35,7 +36,7 @@ def on_chat(msg):
|
|||||||
command = [msg['text']]
|
command = [msg['text']]
|
||||||
if msg['text'][0] == '/':
|
if msg['text'][0] == '/':
|
||||||
command = msg['text'].replace('_', ' ').lower().split(' ')
|
command = msg['text'].replace('_', ' ').lower().split(' ')
|
||||||
command = command.replace(config.NAME, '')
|
command[0] = command[0].replace(config.NAME, '')
|
||||||
|
|
||||||
# first-time user
|
# first-time user
|
||||||
if user.status == '第一次用' and chat_type == 'private':
|
if user.status == '第一次用' and chat_type == 'private':
|
||||||
|
Reference in New Issue
Block a user