Skip to content

Commit

Permalink
Deps: Update Twilight -> v0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMcFelix committed Nov 20, 2023
1 parent be3a4e9 commit 646190e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 29 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ tokio-tungstenite = { optional = true, version = "0.17" }
tokio-util = { features = ["io"], optional = true, version = "0.7" }
tracing = { version = "0.1", features = ["log"] }
tracing-futures = "0.2"
twilight-gateway = { default-features = false, optional = true, version = "0.13.0" }
twilight-model = { default-features = false, optional = true, version = "0.13.0" }
twilight-gateway = { default-features = false, optional = true, version = "0.14.0" }
twilight-model = { default-features = false, optional = true, version = "0.14.0" }
typemap_rev = { optional = true, version = "0.1" }
url = { optional = true, version = "2" }
uuid = { features = ["v4"], optional = true, version = "1" }
Expand Down
3 changes: 1 addition & 2 deletions examples/serenity/voice/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ async fn main() {
// Configure the client with your Discord bot token in the environment.
let token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");

let framework = StandardFramework::new()
.group(&GENERAL_GROUP);
let framework = StandardFramework::new().group(&GENERAL_GROUP);
framework.configure(|c| c.prefix("~"));

let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
Expand Down
3 changes: 1 addition & 2 deletions examples/serenity/voice_cached_audio/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ async fn main() {
// Configure the client with your Discord bot token in the environment.
let token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");

let framework = StandardFramework::new()
.group(&GENERAL_GROUP);
let framework = StandardFramework::new().group(&GENERAL_GROUP);
framework.configure(|c| c.prefix("~"));

let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
Expand Down
3 changes: 1 addition & 2 deletions examples/serenity/voice_events_queue/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ async fn main() {
// Configure the client with your Discord bot token in the environment.
let token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");

let framework = StandardFramework::new()
.group(&GENERAL_GROUP);
let framework = StandardFramework::new().group(&GENERAL_GROUP);
framework.configure(|c| c.prefix("~"));

let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
Expand Down
3 changes: 1 addition & 2 deletions examples/serenity/voice_receive/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ async fn main() {
// Configure the client with your Discord bot token in the environment.
let token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");

let framework = StandardFramework::new()
.group(&GENERAL_GROUP);
let framework = StandardFramework::new().group(&GENERAL_GROUP);
framework.configure(|c| c.prefix("~"));

let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
Expand Down
8 changes: 4 additions & 4 deletions examples/twilight/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ reqwest = "0.11"
tracing = "0.1"
tracing-subscriber = "0.2"
tokio = { features = ["macros", "rt-multi-thread", "sync"], version = "1" }
twilight-gateway = "0.13"
twilight-http = "0.13"
twilight-model = "0.13"
twilight-standby = "0.13"
twilight-gateway = "0.14"
twilight-http = "0.14"
twilight-model = "0.14"
twilight-standby = "0.14"

[dependencies.songbird]
default-features = false
Expand Down
18 changes: 3 additions & 15 deletions examples/twilight/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
let token = env::var("DISCORD_TOKEN")?;

let http = HttpClient::new(token.clone());
let user_id = http.current_user().exec().await?.model().await?.id;
let user_id = http.current_user().await?.model().await?.id;

let intents = Intents::GUILD_MESSAGES | Intents::MESSAGE_CONTENT | Intents::GUILD_VOICE_STATES;
let intents =
Intents::GUILD_MESSAGES | Intents::MESSAGE_CONTENT | Intents::GUILD_VOICE_STATES;
let (cluster, events) = Cluster::new(token, intents).await?;
cluster.up().await;

Expand Down Expand Up @@ -115,7 +116,6 @@ async fn join(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
.http
.create_message(msg.channel_id)
.content("What's the channel ID you want me to join?")?
.exec()
.await?;

let author_id = msg.author.id;
Expand All @@ -142,7 +142,6 @@ async fn join(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
.http
.create_message(msg.channel_id)
.content(&content)?
.exec()
.await?;

Ok(())
Expand All @@ -163,7 +162,6 @@ async fn leave(msg: Message, state: State) -> Result<(), Box<dyn Error + Send +
.http
.create_message(msg.channel_id)
.content("Left the channel")?
.exec()
.await?;

Ok(())
Expand All @@ -179,7 +177,6 @@ async fn play(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
.http
.create_message(msg.channel_id)
.content("What's the URL of the audio to play?")?
.exec()
.await?;

let author_id = msg.author.id;
Expand All @@ -204,7 +201,6 @@ async fn play(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
.http
.create_message(msg.channel_id)
.content(&content)?
.exec()
.await?;

if let Some(call_lock) = state.songbird.get(guild_id) {
Expand All @@ -219,7 +215,6 @@ async fn play(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
.http
.create_message(msg.channel_id)
.content("Didn't find any results")?
.exec()
.await?;
}

Expand Down Expand Up @@ -262,7 +257,6 @@ async fn pause(msg: Message, state: State) -> Result<(), Box<dyn Error + Send +
.http
.create_message(msg.channel_id)
.content(&content)?
.exec()
.await?;

Ok(())
Expand All @@ -278,7 +272,6 @@ async fn seek(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
.http
.create_message(msg.channel_id)
.content("Where in the track do you want to seek to (in seconds)?")?
.exec()
.await?;

let author_id = msg.author.id;
Expand All @@ -304,7 +297,6 @@ async fn seek(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
.http
.create_message(msg.channel_id)
.content(&content)?
.exec()
.await?;

Ok(())
Expand All @@ -328,7 +320,6 @@ async fn stop(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
.http
.create_message(msg.channel_id)
.content("Stopped the track")?
.exec()
.await?;

Ok(())
Expand All @@ -344,7 +335,6 @@ async fn volume(msg: Message, state: State) -> Result<(), Box<dyn Error + Send +
.http
.create_message(msg.channel_id)
.content("What's the volume you want to set (0.0-10.0, 1.0 being the default)?")?
.exec()
.await?;

let author_id = msg.author.id;
Expand All @@ -362,7 +352,6 @@ async fn volume(msg: Message, state: State) -> Result<(), Box<dyn Error + Send +
.http
.create_message(msg.channel_id)
.content("Invalid volume!")?
.exec()
.await?;

return Ok(());
Expand All @@ -381,7 +370,6 @@ async fn volume(msg: Message, state: State) -> Result<(), Box<dyn Error + Send +
.http
.create_message(msg.channel_id)
.content(&content)?
.exec()
.await?;

Ok(())
Expand Down

0 comments on commit 646190e

Please sign in to comment.