Skip to content

feat: allow getting a cooldown with just an id #1337

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

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

Developer89899
Copy link
Contributor

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

Allow users to get a Cooldown system with just an ID, instead of using context.

Changes

  • Add missing docs
  • Add get_cooldown_with_key

Related Issues

https://discord.com/channels/789032594456576001/1095184800916181113/1095196787503009832

Test Scenarios

@slash_command(...)
@cooldown(....)
async def_some_command(...):
    ...

async def some_task(...):
    cooldown = some_command.cooldown.get_cooldown_with_key(174918559539920897)
    cooldown.reset()

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2023

Codecov Report

Patch coverage: 28.57% and project coverage change: -0.01 ⚠️

Comparison is base (09a35a9) 47.70% compared to head (e4f51fd) 47.69%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1337      +/-   ##
============================================
- Coverage     47.70%   47.69%   -0.01%     
============================================
  Files           139      139              
  Lines         14297    14304       +7     
============================================
+ Hits           6821     6823       +2     
- Misses         7476     7481       +5     
Impacted Files Coverage Δ
interactions/models/internal/cooldowns.py 85.48% <28.57%> (-3.41%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Developer89899 Developer89899 enabled auto-merge (squash) April 11, 2023 08:27
@Developer89899 Developer89899 changed the base branch from unstable to sliding-cooldown April 11, 2023 11:21
@Developer89899 Developer89899 merged commit 7f28f3d into sliding-cooldown Apr 11, 2023
@Developer89899 Developer89899 mentioned this pull request Apr 11, 2023
13 tasks
@Developer89899 Developer89899 deleted the cooldown-feat branch April 12, 2023 06:47
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.

2 participants