Change commands and fix tasks numbering
This commit is contained in:
parent
a7db35624b
commit
cea9eb1eab
8
bot.py
8
bot.py
@ -25,15 +25,15 @@ def on_message(msg):
|
|||||||
command = text.split(' ')[0]
|
command = text.split(' ')[0]
|
||||||
arguments = text.split(' ')[1:]
|
arguments = text.split(' ')[1:]
|
||||||
|
|
||||||
if command in ['a', '/a']:
|
if command in ['add', '/add']:
|
||||||
add_task(Task(" ".join(arguments)), chat_id)
|
add_task(Task(" ".join(arguments)), chat_id)
|
||||||
elif command in ['rm', '/rm']:
|
elif command in ['rm', '/rm']:
|
||||||
rm_tasks(arguments, chat_id)
|
rm_tasks(arguments, chat_id)
|
||||||
elif command in ['ls', '/ls']:
|
elif command in ['ls', '/ls']:
|
||||||
ls_tasks(arguments, chat_id)
|
ls_tasks(arguments, chat_id)
|
||||||
elif command in ['d', '/d']:
|
elif command in ['do', '/do']:
|
||||||
do_tasks(arguments, chat_id)
|
do_tasks(arguments, chat_id)
|
||||||
elif command in ['u', '/u']:
|
elif command in ['undo', '/undo']:
|
||||||
undo_tasks(arguments, chat_id)
|
undo_tasks(arguments, chat_id)
|
||||||
|
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ def set_task(task_id, task, chat_id):
|
|||||||
|
|
||||||
def ls_tasks(arguments, chat_id):
|
def ls_tasks(arguments, chat_id):
|
||||||
tasks = get_tasks(chat_id)
|
tasks = get_tasks(chat_id)
|
||||||
counter = 1
|
counter = 0
|
||||||
for i in range(len(tasks)):
|
for i in range(len(tasks)):
|
||||||
tasks[i] = (counter, tasks[i])
|
tasks[i] = (counter, tasks[i])
|
||||||
counter += 1
|
counter += 1
|
||||||
|
Reference in New Issue
Block a user