Deps: Update Twilight -> v0.14

This commit is contained in:
Kyle Simpson
2022-11-20 17:46:11 +00:00
parent be3a4e9b24
commit 646190eaf8
7 changed files with 13 additions and 29 deletions

View File

@@ -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" }

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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;
@@ -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;
@@ -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(())
@@ -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(())
@@ -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;
@@ -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) {
@@ -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?;
}
@@ -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(())
@@ -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;
@@ -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(())
@@ -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(())
@@ -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;
@@ -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(());
@@ -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(())