Deps: Update Twilight -> v0.14
This commit is contained in:
@@ -41,8 +41,8 @@ tokio-tungstenite = { optional = true, version = "0.17" }
|
|||||||
tokio-util = { features = ["io"], optional = true, version = "0.7" }
|
tokio-util = { features = ["io"], optional = true, version = "0.7" }
|
||||||
tracing = { version = "0.1", features = ["log"] }
|
tracing = { version = "0.1", features = ["log"] }
|
||||||
tracing-futures = "0.2"
|
tracing-futures = "0.2"
|
||||||
twilight-gateway = { 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.13.0" }
|
twilight-model = { default-features = false, optional = true, version = "0.14.0" }
|
||||||
typemap_rev = { optional = true, version = "0.1" }
|
typemap_rev = { optional = true, version = "0.1" }
|
||||||
url = { optional = true, version = "2" }
|
url = { optional = true, version = "2" }
|
||||||
uuid = { features = ["v4"], optional = true, version = "1" }
|
uuid = { features = ["v4"], optional = true, version = "1" }
|
||||||
|
|||||||
@@ -67,8 +67,7 @@ async fn main() {
|
|||||||
// Configure the client with your Discord bot token in the environment.
|
// 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 token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
|
||||||
|
|
||||||
let framework = StandardFramework::new()
|
let framework = StandardFramework::new().group(&GENERAL_GROUP);
|
||||||
.group(&GENERAL_GROUP);
|
|
||||||
framework.configure(|c| c.prefix("~"));
|
framework.configure(|c| c.prefix("~"));
|
||||||
|
|
||||||
let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
|
let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
|
||||||
|
|||||||
@@ -94,8 +94,7 @@ async fn main() {
|
|||||||
// Configure the client with your Discord bot token in the environment.
|
// 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 token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
|
||||||
|
|
||||||
let framework = StandardFramework::new()
|
let framework = StandardFramework::new().group(&GENERAL_GROUP);
|
||||||
.group(&GENERAL_GROUP);
|
|
||||||
framework.configure(|c| c.prefix("~"));
|
framework.configure(|c| c.prefix("~"));
|
||||||
|
|
||||||
let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
|
let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
|
||||||
|
|||||||
@@ -74,8 +74,7 @@ async fn main() {
|
|||||||
// Configure the client with your Discord bot token in the environment.
|
// 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 token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
|
||||||
|
|
||||||
let framework = StandardFramework::new()
|
let framework = StandardFramework::new().group(&GENERAL_GROUP);
|
||||||
.group(&GENERAL_GROUP);
|
|
||||||
framework.configure(|c| c.prefix("~"));
|
framework.configure(|c| c.prefix("~"));
|
||||||
|
|
||||||
let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
|
let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
|
||||||
|
|||||||
@@ -144,8 +144,7 @@ async fn main() {
|
|||||||
// Configure the client with your Discord bot token in the environment.
|
// 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 token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
|
||||||
|
|
||||||
let framework = StandardFramework::new()
|
let framework = StandardFramework::new().group(&GENERAL_GROUP);
|
||||||
.group(&GENERAL_GROUP);
|
|
||||||
framework.configure(|c| c.prefix("~"));
|
framework.configure(|c| c.prefix("~"));
|
||||||
|
|
||||||
let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
|
let intents = GatewayIntents::non_privileged() | GatewayIntents::MESSAGE_CONTENT;
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ reqwest = "0.11"
|
|||||||
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.13"
|
twilight-gateway = "0.14"
|
||||||
twilight-http = "0.13"
|
twilight-http = "0.14"
|
||||||
twilight-model = "0.13"
|
twilight-model = "0.14"
|
||||||
twilight-standby = "0.13"
|
twilight-standby = "0.14"
|
||||||
|
|
||||||
[dependencies.songbird]
|
[dependencies.songbird]
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|||||||
@@ -66,9 +66,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
|
|||||||
let token = env::var("DISCORD_TOKEN")?;
|
let token = env::var("DISCORD_TOKEN")?;
|
||||||
|
|
||||||
let http = HttpClient::new(token.clone());
|
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?;
|
let (cluster, events) = Cluster::new(token, intents).await?;
|
||||||
cluster.up().await;
|
cluster.up().await;
|
||||||
|
|
||||||
@@ -115,7 +116,6 @@ async fn join(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content("What's the channel ID you want me to join?")?
|
.content("What's the channel ID you want me to join?")?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let author_id = msg.author.id;
|
let author_id = msg.author.id;
|
||||||
@@ -142,7 +142,6 @@ async fn join(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content(&content)?
|
.content(&content)?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -163,7 +162,6 @@ async fn leave(msg: Message, state: State) -> Result<(), Box<dyn Error + Send +
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content("Left the channel")?
|
.content("Left the channel")?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -179,7 +177,6 @@ async fn play(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content("What's the URL of the audio to play?")?
|
.content("What's the URL of the audio to play?")?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let author_id = msg.author.id;
|
let author_id = msg.author.id;
|
||||||
@@ -204,7 +201,6 @@ async fn play(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content(&content)?
|
.content(&content)?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if let Some(call_lock) = state.songbird.get(guild_id) {
|
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
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content("Didn't find any results")?
|
.content("Didn't find any results")?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,7 +257,6 @@ async fn pause(msg: Message, state: State) -> Result<(), Box<dyn Error + Send +
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content(&content)?
|
.content(&content)?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -278,7 +272,6 @@ async fn seek(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content("Where in the track do you want to seek to (in seconds)?")?
|
.content("Where in the track do you want to seek to (in seconds)?")?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let author_id = msg.author.id;
|
let author_id = msg.author.id;
|
||||||
@@ -304,7 +297,6 @@ async fn seek(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content(&content)?
|
.content(&content)?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -328,7 +320,6 @@ async fn stop(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content("Stopped the track")?
|
.content("Stopped the track")?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -344,7 +335,6 @@ async fn volume(msg: Message, state: State) -> Result<(), Box<dyn Error + Send +
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content("What's the volume you want to set (0.0-10.0, 1.0 being the default)?")?
|
.content("What's the volume you want to set (0.0-10.0, 1.0 being the default)?")?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let author_id = msg.author.id;
|
let author_id = msg.author.id;
|
||||||
@@ -362,7 +352,6 @@ async fn volume(msg: Message, state: State) -> Result<(), Box<dyn Error + Send +
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content("Invalid volume!")?
|
.content("Invalid volume!")?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
@@ -381,7 +370,6 @@ async fn volume(msg: Message, state: State) -> Result<(), Box<dyn Error + Send +
|
|||||||
.http
|
.http
|
||||||
.create_message(msg.channel_id)
|
.create_message(msg.channel_id)
|
||||||
.content(&content)?
|
.content(&content)?
|
||||||
.exec()
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user