Update twilight support to twilight 0.11 (#132)

* update twilight support to twilight 0.11

* rustfmt
This commit is contained in:
Erk
2022-05-25 20:11:57 +00:00
committed by Kyle Simpson
parent 4eb95d4b59
commit 69339e8d45
4 changed files with 10 additions and 13 deletions

View File

@@ -88,12 +88,12 @@ default-features = false
[dependencies.twilight-gateway] [dependencies.twilight-gateway]
optional = true optional = true
version = ">=0.9.0, <0.11.0" version = "0.11.0"
default-features = false default-features = false
[dependencies.twilight-model] [dependencies.twilight-model]
optional = true optional = true
version = ">=0.9.0, <0.11.0" version = "0.11.0"
default-features = false default-features = false
[dependencies.typemap_rev] [dependencies.typemap_rev]

View File

@@ -9,10 +9,10 @@ futures = "0.3"
tracing = "0.1" tracing = "0.1"
tracing-subscriber = "0.2" tracing-subscriber = "0.2"
tokio = { features = ["macros", "rt-multi-thread", "sync"], version = "1" } tokio = { features = ["macros", "rt-multi-thread", "sync"], version = "1" }
twilight-gateway = "0.10" twilight-gateway = "0.11"
twilight-http = "0.10" twilight-http = "0.11"
twilight-model = "0.10" twilight-model = "0.11"
twilight-standby = "0.10" twilight-standby = "0.11"
[dependencies.songbird] [dependencies.songbird]
default-features = false default-features = false

View File

@@ -105,11 +105,7 @@ impl Songbird {
{ {
Self { Self {
client_data: PRwLock::new(ClientData { client_data: PRwLock::new(ClientData {
shard_count: cluster shard_count: cluster.config().shard_scheme().total(),
.config()
.shard_scheme()
.total()
.unwrap_or_else(|| cluster.shards().len() as u64),
initialised: true, initialised: true,
user_id: user_id.into(), user_id: user_id.into(),
}), }),

View File

@@ -24,8 +24,9 @@ impl fmt::Display for TrackError {
write!(f, "failed to operate on track (handle): ")?; write!(f, "failed to operate on track (handle): ")?;
match self { match self {
TrackError::Finished => write!(f, "track ended"), TrackError::Finished => write!(f, "track ended"),
TrackError::InvalidTrackEvent => TrackError::InvalidTrackEvent => {
write!(f, "given event listener can't be fired on a track"), write!(f, "given event listener can't be fired on a track")
},
TrackError::SeekUnsupported => write!(f, "track did not support seeking"), TrackError::SeekUnsupported => write!(f, "track did not support seeking"),
} }
} }