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

Add a decorator that stops successive duplicate invocations of commands #88

Merged
merged 21 commits into from Oct 25, 2022

Conversation

Numerlor
Copy link
Contributor

@Numerlor Numerlor commented Jun 14, 2022

Ports over update_wrapper_globals/command_wraps and adds a decorator that stops successive duplicate invocations of a command with the same arguments in the same channel.

I've extended the source lookup func for linkcode to also look into if statements for the if TYPE_CHECKING use and added a guard to prevent if from erroring on cases that aren't taken care of. It's still missing on some different cases where assignments could occur but that can be addressed in a different PR specifically for that

closes: #87

@netlify
Copy link

netlify bot commented Jun 14, 2022

Deploy Preview for bot-core failed.

Name Link
🔨 Latest commit a6f1ebf
🔍 Latest deploy log https://app.netlify.com/sites/bot-core/deploys/63336d9b62aec500085b7d0e

botcore/utils/function.py Outdated Show resolved Hide resolved
botcore/utils/function.py Outdated Show resolved Hide resolved
botcore/utils/cooldown.py Outdated Show resolved Hide resolved
botcore/utils/cooldown.py Outdated Show resolved Hide resolved
botcore/utils/cooldown.py Outdated Show resolved Hide resolved
botcore/utils/cooldown.py Outdated Show resolved Hide resolved
botcore/utils/cooldown.py Show resolved Hide resolved
botcore/utils/cooldown.py Outdated Show resolved Hide resolved
botcore/utils/cooldown.py Show resolved Hide resolved
botcore/utils/cooldown.py Outdated Show resolved Hide resolved
Numerlor and others added 3 commits June 21, 2022 17:59
@HassanAbouelela HassanAbouelela added a: code Pull requests which add features, fixes, or any code change t: feature labels Jul 23, 2022
Copy link
Member

@MarkKoz MarkKoz left a comment

Choose a reason for hiding this comment

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

Hey, I forgot about this PR. Sorry it took me so long to take notice again. Just have some small suggestions.

botcore/utils/cooldown.py Outdated Show resolved Hide resolved
botcore/utils/cooldown.py Outdated Show resolved Hide resolved
botcore/utils/cooldown.py Outdated Show resolved Hide resolved
@Numerlor
Copy link
Contributor Author

For the failing doc I've opened tox-dev/sphinx-autodoc-typehints#255

Copy link
Member

@MarkKoz MarkKoz left a comment

Choose a reason for hiding this comment

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

I'm out of my depth with the sphinx changes you've made, so I'll defer reviews of that to someone more experienced.

Copy link
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. Once sphinx-autodoc-typehints makes a release with your change we can get this updated and merged!

@ChrisLovering ChrisLovering merged commit c7a6ddd into python-discord:main Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: code Pull requests which add features, fixes, or any code change t: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide command decorator for blocking duplicated command output
4 participants