Compare commits
4 Commits
fuzzymerge
...
1.0
Author | SHA1 | Date | |
---|---|---|---|
9e300fe38f
|
|||
e1654bb023
|
|||
14e942355b
|
|||
ec07146c08
|
@@ -1,3 +1,5 @@
|
||||
# this is the old version of the bot!!
|
||||
|
||||
# todo.txt as a Telegram bot
|
||||
A bot to hold your todo.txt tasks
|
||||
|
||||
|
@@ -14,7 +14,7 @@ from fuzzywuzzy import process
|
||||
from fuzzywuzzy import fuzz
|
||||
from pydo import Task
|
||||
|
||||
VERSION = "v1.2.0fuzzymerge:untested"
|
||||
VERSION = "v1.2.1"
|
||||
|
||||
|
||||
PROPERTY_LAST_COMMAND = "last_command"
|
||||
@@ -22,7 +22,7 @@ PROPERTY_LAST_ARGUMENTS = "last_arguments"
|
||||
|
||||
CONFIG_FILE = '/config/config.json'
|
||||
ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
TASKS_FILE="/config/tasks.json"
|
||||
TASKS_FILE = "/config/tasks.json"
|
||||
|
||||
|
||||
with open(CONFIG_FILE) as file:
|
||||
@@ -88,7 +88,8 @@ def process_command(chat_id, command, arguments):
|
||||
delete_all_tasks(chat_id)
|
||||
elif command == '/priority':
|
||||
#priority(chat_id, arguments)
|
||||
function_fuzzy_checker(chat_id, arguments, priority, ignore=[0], handler=fuzzy_priority_handler)
|
||||
function_fuzzy_checker(chat_id, arguments, priority, ignore=[0],
|
||||
handler=fuzzy_priority_handler)
|
||||
else:
|
||||
set_property(chat_id, PROPERTY_LAST_COMMAND, '/add')
|
||||
set_property(chat_id, PROPERTY_LAST_ARGUMENTS, arguments)
|
||||
@@ -510,7 +511,7 @@ def fuzzy_priority_handler(chat_id, text, function):
|
||||
def function_fuzzy_checker(chat_id, arguments, function, ignore=[], handler=fuzzy_action):
|
||||
"""
|
||||
Checks if the all arguments are numerical and if they are it runs the
|
||||
function, otherwise it runs fuzzy_action with that function.
|
||||
function, otherwise it runs fuzzy_action with that function.
|
||||
:param chat_id: Telegram chat_id
|
||||
:param arguments: list of arguments form process_command
|
||||
:param function: the function to be executed
|
||||
|
14
src/help.md
14
src/help.md
@@ -4,16 +4,10 @@ Anything sent without a command is assumed to be a new task to be added
|
||||
|
||||
## actions on tasks
|
||||
- `/add <task-text>` - Add a new task
|
||||
- `/do <id> [id [id [id]...]]` - Do task(s)
|
||||
- `/priority <priority> <id> [id [id [id]...]]` - Set the priority of task(s)
|
||||
- `/rm <id> [id [id [id]...]]` - Remove task(s)
|
||||
- `/undo <id> [id [id [id]...]]` - undo task(s)
|
||||
|
||||
### fuzzy actions
|
||||
- `/fdo <text to match>`
|
||||
- `/fpriority <text to match>`
|
||||
- `/frm <text to match>`
|
||||
- `/fundo <text to match>`
|
||||
- `/do` - Mark a task as done
|
||||
- `/priority` - Set the priority of a task
|
||||
- `/rm` - Remove a task
|
||||
- `/undo` - Mark a task as not done
|
||||
|
||||
## general
|
||||
- `/export` - Send all tasks as plaintext
|
||||
|
Reference in New Issue
Block a user