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

Activities is required when updating presence #891

Merged
merged 4 commits into from
Jun 7, 2021

Conversation

7596ff
Copy link
Contributor

@7596ff 7596ff commented Jun 6, 2021

This PR removes the Some from UpdateStatusInfo, as the list is now
required. It also validates that at least one activity is present when
using the new method.

Fixes #858.

This PR removes the `Some` from `UpdateStatusInfo`, as the list is now
required. It also validates that at least one activity is present when
using the `new` method.

Fixes twilight-rs#858.
@7596ff 7596ff added m-breaking change Breaks the public API. c-gateway Affects the gateway crate c-model Affects the model crate d-api Change related to Discord's API. t-chore labels Jun 6, 2021
@7596ff 7596ff linked an issue Jun 6, 2021 that may be closed by this pull request
model/src/gateway/payload/update_status.rs Outdated Show resolved Hide resolved
model/src/gateway/payload/update_status.rs Outdated Show resolved Hide resolved
model/src/gateway/payload/update_status.rs Outdated Show resolved Hide resolved
@Erk- Erk- merged commit ae6a5f5 into twilight-rs:next Jun 7, 2021
@7596ff 7596ff deleted the docs/requied-activities branch June 8, 2021 12:49
7596ff added a commit to 7596ff/twilight that referenced this pull request Jun 13, 2021
…wilight-rs#891)

This PR removes the `Some` from `UpdateStatusInfo`, as the list is now
required. It also validates that at least one activity is present when
using the `new` method.

Fixes twilight-rs#858.
7596ff added a commit to 7596ff/twilight that referenced this pull request Jun 13, 2021
…wilight-rs#891)

This PR removes the `Some` from `UpdateStatusInfo`, as the list is now
required. It also validates that at least one activity is present when
using the `new` method.

Fixes twilight-rs#858.
7596ff added a commit to 7596ff/twilight that referenced this pull request Jun 13, 2021
…wilight-rs#891)

This PR removes the `Some` from `UpdateStatusInfo`, as the list is now
required. It also validates that at least one activity is present when
using the `new` method.

Fixes twilight-rs#858.
7596ff added a commit to 7596ff/twilight that referenced this pull request Jun 13, 2021
…wilight-rs#891)

This PR removes the `Some` from `UpdateStatusInfo`, as the list is now
required. It also validates that at least one activity is present when
using the `new` method.

Fixes twilight-rs#858.
7596ff added a commit that referenced this pull request Jun 13, 2021
Upgrade Path

Replace `zlib` features with their new names.

Create a `Cluster` or `Shard` like this:

```diff
-let cluster = Cluster::new(token, intents).await?;
-let mut events = cluster.events();
+let (cluster, mut events) = Cluster::new(token, intents).await?;
```

Replace references to `UpdateStatus` and `UpdateStatusInfo` with
`UpdatePresence` and `UpdatePresencePayload` respectively.

Ensure at least one `Activity` is present in `UpdatePresence`.

Changes

The `zlib` feature choices have been renamed from `'stock-zlib` and
`simd-zlib` to `zlib-stock` and `zlib-simd` respectively ([#829] -
[@vivian]).

`Cluster::new`, `ClusterBuilder::build`, `Shard::new`, and
`ShardBuilder::build` now return a tuple with two elements: the cluster
or shard itself and a stream of events. See the PR for more details
([#832] - [@vivian]).

`UpdateStatus` and `UpdateStatusInfo` have been renamed to
`UpdatePresence` and `UpdatePresencePayload` respectively ([#902] -
[@7596ff]).

At least one `Activity` is required when building an `UpdatePresence`
payload.  `UpdatePresenceError` and `UpdatePresenceErrorType` have been
created to validate this ([#891] - [@7596ff]).

[#829]: #829
[#832]: #832
[#891]: #891
[#902]: #902

[@7596ff]: https://github.com/7596ff
[@vivian]: https://github.com/vivian
7596ff added a commit that referenced this pull request Jun 13, 2021
Upgrade Path

Remove references to `Guild::nsfw`, `Guild::region`,
`PartialGuild::nsfw`, `PartialGuild::region`, and
`TemplateGuild::region`.

Replace the following usages:
```diff
-twilight_model::channel::invite::TargetUserType
+twilight_model::channel::invite::TargetType

-twilight_model::gateway::payload::update_status::UpdateStatus
+twilight_model::gateway::payload::update_presence::UpdatePresence

-twilight_model::gateway::payload::update_status::UpdateStatusInfo
+twilight_model::gateway::payload::update_presence::UpdatePresencePayload
```

Additions

Support for Slash Commands has been added. New models are present in the
`application` module ([#932]).

Enhancements

The following models have been updated:

- `twilight_model::channel::message::MessageFlags`: added `EPHEMERAL`
- `twilight_model::channel::Message`: added `application_id`, `interaction`
- `twilight_model::channel::WebhookType`: added `Application`
- `twilight_model::gateway::Event`: added `InteractionCreate`
- `twilight_model::gateway::payload::Ready`: added `application`
- `twilight_model::guild::PartialMember`: added `permissions`

Changes

The `TargetType` re-export (`TargetUserType`) has been removed ([#847] -
[@7596ff]).

`Guild::nsfw` and `PartialGuild::nsfw` have been removed ([#890] - [@7596ff]).

`UpdateStatus` and `UpdateStatusInfo` have been renamed to
`UpdatePresence` and `UpdatePresencePayload` respectively ([#902] -
[@7596ff]).

At least one `Activity` is required when building an `UpdatePresence`
payload.  `UpdatePresenceError` and `UpdatePresenceErrorType` have been
created to validate this ([#891] - [@7596ff]).

References to `Guild::region` have been removed. This includes
`PartialGuild::region` and `TemplateGuild::region` ([#930] - [@7596ff]).

[#847]: #847
[#890]: #890
[#891]: #891
[#902]: #902
[#930]: #930
[#932]: #932

[@7596ff]: https://github.com/7596ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-gateway Affects the gateway crate c-model Affects the model crate d-api Change related to Discord's API. m-breaking change Breaks the public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List of activities is required when updating status
3 participants