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 timeout utility extensions methods #130

Closed
Ayfri opened this issue Jan 25, 2022 · 2 comments
Closed

Add timeout utility extensions methods #130

Ayfri opened this issue Jan 25, 2022 · 2 comments
Labels
Type: Feature Suggestions and tracking for new features.

Comments

@Ayfri
Copy link
Contributor

Ayfri commented Jan 25, 2022

Summary

Add a method to easily timeout a member for a duration and a method to disable timeout of a member.

Current Behaviour

Editing the member timeoutUntil or communicationDisabledUntil property, if we want to deactivate until now + a duration, we have to include a calculation into our code.

Preferred Behaviour

Use methods for this.

Suggestions

/**
 * Disable communication for a member until now + duration.
 * Returns false if the bot cannot set the timeout for the member, otherwise true.
**/
suspend fun MemberBehavior.timeout(duration: Duration): Boolean
// and maybe also
suspend fun MemberBehavior.timeout(seconds: int): Boolean

/**
 * Remove disabled communication for a member.
 * Returns false if the bot cannot enable communication for member, otherwise true.
**/
suspend fun MemberBehavior.stopTimeout()
@Ayfri Ayfri added the Type: Feature Suggestions and tracking for new features. label Jan 25, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 25, 2022

Hello, and thanks for opening an issue! As this is the first time you've created an issue on this repository, we'd just like to offer you a warm welcome to the project, and the following pointers:

  • Most importantly, all issues must adhere to our Code of Conduct. Please give it a quick read if you haven't already.

  • While our team is passionate about the projects we've created here, we're all volunteers. Please don't be offended if it takes time for us to get to your issue - we'll be here as soonas we can be!

  • Please provide as much information as possible when asking a question, reporting a problem, or submitting a feature request. This will help us to address your issue quickly and efficiently. If you forgot to add some information, no worries - feel free to edit the issue and add anything you missed!

    Thanks for contacting us! If you have any further questions, please feel free to join us on Discord in the #dev-kotdis channel (or #kordex-discussion for Kord Extensions projects), or to contact a staff member directly.

@gdude2002
Copy link
Member

Done!

DRSchlaubi pushed a commit to mikbot/kord-extensions that referenced this issue Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Suggestions and tracking for new features.
Projects
None yet
Development

No branches or pull requests

2 participants