Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Course ECP Command #171

Merged
merged 13 commits into from
Nov 2, 2023
Merged

Course ECP Command #171

merged 13 commits into from
Nov 2, 2023

Conversation

ew-b
Copy link
Contributor

@ew-b ew-b commented Oct 24, 2023

Sick of closing Discord for 30 seconds to search for the course code? Great news that is no more! With the new /courseecp command, you can request the ECPs for up to four courses for a semester, year, mode, and campus. It assumes the courses are offered in the same semester and that they all are the same mode of delivery and campus. If semester, year, mode and campus are not provided, it defaults to the current semester and year.

Further development of this command could be removing those assumptions and making it more complex for what it takes as inputs.

ew-b and others added 9 commits April 14, 2023 12:50
Made xkcd_desc an f string, added spoiler `||` on either side so when it's posted to discord it spoilers the text.
Attempting to create a command that takes in a course code, selected year, semester, mode, and campus and then provides the link to the course profile.

Currently it defaults to the current semester and I'm yet to work out how to make it not default.
Need to format the embedded and allow it to take in multiple courses
It assume when requesting you want the same semester, year, mode and campus for all courses.
@ew-b ew-b self-assigned this Oct 24, 2023
Copy link
Member

@49Indium 49Indium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see your first PR! Overall great style. I like the detail in the description of the command. and the error checking is superb (I like how the error messages are informative based on the type of error). There is some code duplication that would be nice if removed, but it really stems from past poor design choices (of mine). Looks like a great command for the bot to have.

uqcsbot/course_ecp.py Outdated Show resolved Hide resolved
uqcsbot/course_ecp.py Show resolved Hide resolved
uqcsbot/course_ecp.py Outdated Show resolved Hide resolved
uqcsbot/course_ecp.py Outdated Show resolved Hide resolved
ew-b added 2 commits October 27, 2023 20:40
- Fixed typo
- Clarified error message
- Changes wording of the else statement that in theory should never happen because of the exceptions.
Unsure if this will cause issues, doesn't look like it and improve any future use of checking what the estimated current semester is.
@ew-b
Copy link
Contributor Author

ew-b commented Oct 27, 2023

Changes as requested made, no clue what to do with Black though

49Indium
49Indium previously approved these changes Oct 27, 2023
Copy link
Member

@49Indium 49Indium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (Other than black)

andrewj-brown
andrewj-brown previously approved these changes Oct 27, 2023
Copy link
Member

@andrewj-brown andrewj-brown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

You can fix the styling by doing poetry run black uqcsbot (or python -m poetry run black uqcsbot, if memory of your setup serves me correctly)

@ew-b ew-b dismissed stale reviews from andrewj-brown and 49Indium via c1ceb09 November 2, 2023 05:32
@ew-b
Copy link
Contributor Author

ew-b commented Nov 2, 2023

@andrewj-brown or @49Indium Black has been sorted, thank ya'll

Copy link
Member

@49Indium 49Indium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@49Indium 49Indium merged commit 86b238b into main Nov 2, 2023
3 checks passed
@49Indium 49Indium deleted the logging branch November 2, 2023 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants