Skip to content

fix: display help for the correct command when an error occurs in timed#679

Merged
Xithrius merged 1 commit into
mainfrom
vcokltfre/fix/timed-error-help
Apr 14, 2021
Merged

fix: display help for the correct command when an error occurs in timed#679
Xithrius merged 1 commit into
mainfrom
vcokltfre/fix/timed-error-help

Conversation

@vcokltfre
Copy link
Copy Markdown
Contributor

Description

When a new execution context is created in the timed command it's now added as the subcontext attribute of the parent context. When the error handler deals with the error the context is set to the subcontext if available, else the normal context. This means the command displays correctly.

Reasoning

It's been implemented this way since I believe it to be the cleanest and simplest way to do this. If this turns out not to be the case I'm more than happy to change the implementation to something more suitable.

Screenshots

Before:
image
After:
image

Did you:

  • Join the Python Discord Community?
  • If dependencies have been added or updated, run pipenv lock?
  • Lint your code (pipenv run lint)?
  • Set the PR to allow edits from contributors?

Copy link
Copy Markdown
Contributor

@ToxicKidz ToxicKidz left a comment

Choose a reason for hiding this comment

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

:shipit: :shipit: :shipit:

Copy link
Copy Markdown
Member

@ChrisLovering ChrisLovering left a comment

Choose a reason for hiding this comment

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

Looks good to me, tested locally.

Copy link
Copy Markdown
Contributor

@Xithrius Xithrius left a comment

Choose a reason for hiding this comment

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

Is there a way of having the bot send something like .timed uwu <text>?

@vcokltfre
Copy link
Copy Markdown
Contributor Author

I'll see what I can do, but I get the feeling the solution may end up being quite ugly, anyway, will see :P

@Xithrius Xithrius added area: backend Related to internal functionality and utilities season: evergreen status: WIP Work In Progress type: enhancement Changes or improvements to existing features labels Apr 14, 2021
Comment thread bot/exts/evergreen/timed.py Outdated
@vcokltfre vcokltfre force-pushed the vcokltfre/fix/timed-error-help branch from 386e178 to fbe8e0a Compare April 14, 2021 04:24
Copy link
Copy Markdown
Contributor

@Xithrius Xithrius left a comment

Choose a reason for hiding this comment

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

Yes.

@Xithrius Xithrius merged commit de3327c into main Apr 14, 2021
@Xithrius Xithrius deleted the vcokltfre/fix/timed-error-help branch April 14, 2021 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backend Related to internal functionality and utilities status: WIP Work In Progress type: enhancement Changes or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants