-
Notifications
You must be signed in to change notification settings - Fork 19
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
Updated SFU modules to slash commands #671
base: master
Are you sure you want to change the base?
Conversation
will review next weekend but @TitanVJ may want to take a crack at it first since he's the one who wrote and knows that command more intimately than I do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me. Very nice work @chanchantang !!
Maybe turn it into a boolean arg? call it
What do you mean by this, looks like the code is using the arguments?
dont know why i made that comment, you can remove it.
Looks like the outlines api has been updated and the building code and room number are no longer provided:
The outlines request is chunked because the response is sometimes too large, but that isn't a concern with the calendar api that's used in the courses() command. If there was an issue we would've encountered it by now since this codes been running for years. @chanchantang my attempt at addressing some of your notes. |
This part of the code below in wall_e/wall_e/extensions/sfu.py Lines 322 to 333 in 985095b
However, since that function also possibly embeds a message, we would also need to pass interaction . So the option is either, the current, _construct_fields(data, info, schedule) or _construct_fields(interaction, data) .
|
Also forgot to mention, but I removed the help message, not sure how to support it with the slash commands. |
I'd got w/ the ladder option, seems cleaner overall. |
That's fine, if someones stuck they can use the actual help command. |
Oh, forgot to mention that the standard error message we embed relies on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small fixes and then I will merge
self.logger.debug('[SFU sfu()] out sent to server') | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary return
await ctx.send(embed=e_obj, reference=ctx.message) | ||
return | ||
|
||
async def _construct_fields(self, interaction, data): | ||
self.logger.debug('[SFU outline()] parsing data from get request') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.logger.debug('[SFU outline()] parsing data from get request') | |
self.logger.debug('[SFU _construct_fields()] parsing data from get request') |
@@ -391,18 +165,10 @@ async def outline(self, ctx, *course): | |||
schedule = data['courseSchedule'] | |||
except Exception: | |||
self.logger.debug('[SFU outline()] info keys didn\'t exist') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.logger.debug('[SFU outline()] info keys didn\'t exist') | |
self.logger.debug('[SFU _construct_fields()] info keys didn\'t exist') |
4d062d9
to
bea3b20
Compare
08e135d
to
2bc735e
Compare
Description
In regard to issue #667
Converted
def sfu()
anddef outline()
to slash commands. Also rewrote existing commands to be more clean and DRY.Things to Note:
outline()
, I am unsure how to have the optional argument “next”, current setup as an input argument calledarg
_construct_fields()
_construct_fields()
could not use theinfo
andschedule
arguments, however it would requireinteraction
to embed an error message. Unsure which is better_split_course
, I return an error using a third return value, there may be a better way to do thiscourses()
function, it does not chunk the get request, could be a concernPR Checklist
All test cases done in the test cases section are passed except for required arguments now being shown in the Discord UI due to the command being converted from
.
to/