1
0

4 Commits

Author SHA1 Message Date
9e300fe38f update readme 2021-02-25 21:24:57 +00:00
e1654bb023 Update help.md 2018-12-19 17:04:18 +00:00
14e942355b Update version number 2018-12-19 17:00:21 +00:00
ec07146c08 minor edits 2018-12-19 16:54:27 +00:00
3 changed files with 11 additions and 14 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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