rumdood / Moneo

Telegram Bot for Managing Scheduled Tasks and Reminders
MIT License
2 stars 0 forks source link

Allow for Fuzzy Matching of Task Identification for Bot Commands #16

Closed rumdood closed 9 months ago

rumdood commented 9 months ago

Allow for fuzzier matching to determine what task is the target of a bot command like /complete.

To implement this, consider modifying the IDs of the tasks to be UUIDs and and let the name be a sort of "short description" of the task. Then utilize some level of fuzzy matching so that the following scenario works:

User: /create Call My Doctor Tomorrow Bot: Task "Call My Doctor Tomorrow" created User: /complete call doctor Bot: "Call My Doctor Tomorrow" completed

rumdood commented 9 months ago

Found an issue with matching as the "id" of the task is not the name, but the url slug used for the task (e.g. api/1001/tasks/takemeds the "takemeds" is the id to match) and this is not included in the entity.

Need to start returning this ID in the entity payload when pulled from the function. Feels like yet another reason that this is is evolving past being fine with just durable entities as the backing store.

rumdood commented 9 months ago

Proposed change to MoneoTaskDto:

{
  "id": "taskslug",
  "conversationId": 1001,
  ...
}

This would free up the id/slug to be auto-generated as a UUID or something similar rather than having to be semi-human-readable.