Add /mycourses to save and manage courses #193

Open
opened 2026-06-06 03:21:58 +00:00 by TenType · 0 comments
TenType commented 2026-06-06 03:21:58 +00:00 (Migrated from codeberg.org)

Summary

Create a command that lets users keep track of their courses and share them with others!

Objectives

This command should have the following subcommands:

  • /mycourses add <course_codes> - add the course(s) to user's list
  • /mycourses remove <course_codes | all> - remove the specified course(s) or all courses from the user's list
  • /mycourses list - show a list of the user's courses saved
  • /mycourses fce - functions the same as /fce <course_codes>

As an example, try TurtleBot's &myclasses commands!

Suggested Approach

Add a new file called mycourses.ts in src/commands. For course-related functionality, see if you can import functions fromutils/index.ts, fce.ts, and courses.ts to avoid code duplication. If necessary, feel free to make minor refactoring changes to these as well to make functionality importable into mycourses.ts.

We use Drizzle ORM to work with the database. You'll have to update db/schema.ts with a new schema representing a table with user_id and course_codes, then run deno run db:generate and deno run db:migrate to create and apply your new SQL migration. See src/commands/redirect-list.ts for a good example of how to use the database.

## Summary Create a command that lets users keep track of their courses and share them with others! ## Objectives This command should have the following subcommands: - [ ] `/mycourses add <course_codes>` - add the course(s) to user's list - [ ] `/mycourses remove <course_codes | all>` - remove the specified course(s) or all courses from the user's list - [ ] `/mycourses list` - show a list of the user's courses saved - [ ] `/mycourses fce` - functions the same as `/fce <course_codes>` As an example, try TurtleBot's `&myclasses` commands! ## Suggested Approach Add a new file called `mycourses.ts` in `src/commands`. For course-related functionality, see if you can import functions from`utils/index.ts`, `fce.ts`, and `courses.ts` to avoid code duplication. If necessary, feel free to make minor refactoring changes to these as well to make functionality importable into `mycourses.ts`. We use [Drizzle ORM](https://orm.drizzle.team/docs/overview) to work with the database. You'll have to update `db/schema.ts` with a new schema representing a table with `user_id` and `course_codes`, then run `deno run db:generate` and `deno run db:migrate` to create and apply your new SQL migration. See `src/commands/redirect-list.ts` for a good example of how to use the database.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/dalmatian#193
No description provided.