Gateway: Twilight v0.9 support (#110)
This handles twilight's migration to a unified `Id` type, which is the only design change needing any handling on our part. All our `From`/`Into`s are covered now, and deprecated type aliases are no longer used. This was tested using `cargo make ready` and by manually running "examples/twilight".
This commit is contained in:
@@ -9,10 +9,10 @@ futures = "0.3"
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = "0.2"
|
||||
tokio = { features = ["macros", "rt-multi-thread", "sync"], version = "1" }
|
||||
twilight-gateway = "0.8"
|
||||
twilight-http = "0.8"
|
||||
twilight-model = "0.8"
|
||||
twilight-standby = "0.8"
|
||||
twilight-gateway = "0.9"
|
||||
twilight-http = "0.9"
|
||||
twilight-model = "0.9"
|
||||
twilight-standby = "0.9"
|
||||
|
||||
[dependencies.songbird]
|
||||
default-features = false
|
||||
|
||||
@@ -30,7 +30,11 @@ use std::{collections::HashMap, env, error::Error, future::Future, sync::Arc};
|
||||
use tokio::sync::RwLock;
|
||||
use twilight_gateway::{Cluster, Event, Intents};
|
||||
use twilight_http::Client as HttpClient;
|
||||
use twilight_model::{channel::Message, gateway::payload::incoming::MessageCreate, id::GuildId};
|
||||
use twilight_model::{
|
||||
channel::Message,
|
||||
gateway::payload::incoming::MessageCreate,
|
||||
id::{marker::GuildMarker, Id},
|
||||
};
|
||||
use twilight_standby::Standby;
|
||||
|
||||
type State = Arc<StateRef>;
|
||||
@@ -38,7 +42,7 @@ type State = Arc<StateRef>;
|
||||
#[derive(Debug)]
|
||||
struct StateRef {
|
||||
http: HttpClient,
|
||||
trackdata: RwLock<HashMap<GuildId, TrackHandle>>,
|
||||
trackdata: RwLock<HashMap<Id<GuildMarker>, TrackHandle>>,
|
||||
songbird: Songbird,
|
||||
standby: Standby,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user