Deps: Bump twilight versions -> 0.5 (#79)

This commit is contained in:
Vilgot Fredenberg
2021-06-14 16:26:55 +02:00
committed by Kyle Simpson
parent 00c8bc915a
commit d6d6acabe1
4 changed files with 20 additions and 21 deletions

View File

@@ -10,12 +10,12 @@ tracing = "0.1"
tracing-subscriber = "0.2"
serde_json = { version = "1" }
tokio = { features = ["macros", "rt-multi-thread", "sync"], version = "1" }
twilight-gateway = "0.4"
twilight-http = "0.4"
twilight-model = "0.4"
twilight-standby = "0.4"
twilight-gateway = "0.5"
twilight-http = "0.5"
twilight-model = "0.5"
twilight-standby = "0.5"
[dependencies.songbird]
path = "../.."
default-features = false
features = ["twilight-rustls", "gateway", "driver", "stock-zlib"]
features = ["twilight-rustls", "gateway", "driver", "zlib-stock"]

View File

@@ -57,15 +57,16 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
// Initialize the tracing subscriber.
tracing_subscriber::fmt::init();
let token = env::var("DISCORD_TOKEN")?;
let http = HttpClient::new(&token);
let (cluster, mut events) =
Cluster::new(token, Intents::GUILD_MESSAGES | Intents::GUILD_VOICE_STATES).await?;
let state = {
let token = env::var("DISCORD_TOKEN")?;
let http = HttpClient::new(&token);
let user_id = http.current_user().await?.id;
let cluster =
Cluster::new(token, Intents::GUILD_MESSAGES | Intents::GUILD_VOICE_STATES).await?;
let shard_count = cluster.shards().len();
let songbird = Songbird::twilight(cluster.clone(), shard_count as u64, user_id);
@@ -80,8 +81,6 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
}
};
let mut events = state.cluster.events();
while let Some(event) = events.next().await {
state.standby.process(&event.1);
state.songbird.process(&event.1).await;