Skip to content

Add: ToDo list command group #77

@z404

Description

@z404

Group Description

This command group will consist of the following commands:

  • !taskadd <message>
  • !taskremove <index_number>
  • !tasklist

TaskAdd Command:

When the user runs the command, the bot should do the following tasks:

  • check if the key todolist_<userid> exists in the database (specified in issue Add: Set of functions that act as database functions #34)
  • if the key exists, then obtain the value of that key (is a string, list of tasks seperated by a ;)
  • append the new task to this list, and write the entire string back into the database with the same key todolist_<userid>

TaskRemove Command:

When the user runs this command, the bot must do the following task

  • check if the key todolist_<userid> exists in the database
  • if the key exists, then obtain the value of that key (is a string, list of tasks seperated by a ;)
  • parse the string into a list, and delete the entry at the given index
  • convert the list back into a string, each element seperated by a semicolon, and write it back into the file with the key todolist_<userid>

TaskList Command:

Display the list of tasks stored in the database with proper formatting, or a relevant error message

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions