marcelropos / HM-DiscordBot

A Discordbot by and for first semester students of HM.
8 stars 5 forks source link

Add subject show command #180

Open maxwai opened 12 months ago

maxwai commented 12 months ago

Add command to show all available subject for a user in a list with indexes

schitcrafter commented 9 months ago

How are the indices for this list generated? They need to be generated by some deterministic algorithm in order for the subject add/rm commands to function with indices (#181 ), but I'm not sure how to do this best (maybe sorting the names alphabetically?)

Edit: Also, the logic of which subjects are shown to a user isn't detailed anywhere, as far as I can tell

maxwai commented 9 months ago

Ah yes I forgot that. The index (id) should be saved in the database. I will add it to the database as an incrementing int. Then this will be used for indexing.

As for the logic, one can look at the python code, but in a nutshell: Say a user is in study group IF3, then he will have access to all subjects that are linked with IF3 and also all semesters below, so IF2 and IF1

schitcrafter commented 9 months ago

I'll add it to the database myself because I've already started working on the command, and I'd say that it's in the scope of this issue.

maxwai commented 9 months ago

Yes works too