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

Guild::afk_timeout values #1904

Closed
7596ff opened this issue Sep 15, 2022 · 1 comment · Fixed by #1922
Closed

Guild::afk_timeout values #1904

7596ff opened this issue Sep 15, 2022 · 1 comment · Fixed by #1922
Assignees
Labels
c-http Affects the http crate c-model Affects the model crate d-api Change related to Discord's API. t-feature Addition of a new feature

Comments

@7596ff
Copy link
Contributor

7596ff commented Sep 15, 2022

Docs PR: discord/discord-api-docs#5336

@7596ff 7596ff added t-feature Addition of a new feature c-http Affects the http crate c-model Affects the model crate d-api Change related to Discord's API. labels Sep 15, 2022
@itohatweb itohatweb self-assigned this Sep 16, 2022
itohatweb added a commit that referenced this issue Sep 16, 2022
The afk timeout can be set to `60`, `300`, `900`, `1800`, and `3600` in
order to provide a better UX a struct has been added (`AfkTimeout`).

Reference: #1904

Closes: #1904
7596ff pushed a commit that referenced this issue Jan 6, 2023
…1922)

The AFK timeout of a guild has been represented as an integer, despite
the fact that the AFK timeout of a guild can only be a select list of
integers rather than a freeform value. To achieve a nice UX while
maintaining the representation of an integer, a newtype over an integer
with associated constants for known valid values has been introduced.

Example:

```rust
use twilight_model::guild::AfkTimeout;

assert_eq!(300, AfkTimeout::FIVE_MINUETES.get());
assert_eq!(300, AfkTimeout::FIVE_MINUTES); // impl PartialEq<AfkTimeout> for u16
```

Reference: #1904

Closes: #1904
@zeylahellyer
Copy link
Member

Closed by #1922

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-http Affects the http crate c-model Affects the model crate d-api Change related to Discord's API. t-feature Addition of a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants