diff --git a/Cargo.toml b/Cargo.toml index 0f0b67a..eae8539 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,5 +22,5 @@ regex = "1.5.4" reqwest = "0.11.6" serde = "1.0.130" serde_json = "1.0.69" -serenity = { version = "0.10", features = [ "collector" ] } +serenity = { version = "0.10", features = [ "collector", "unstable_discord_api" ] } tokio = { version = "1.13.0", features = ["sync", "macros", "rt-multi-thread"] } diff --git a/src/lib.rs b/src/lib.rs index d808859..93bbbdd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -99,6 +99,10 @@ pub async fn prepare_client(arguments: ArgMatches<'_> "Could not find an environment variable called DISCORD_TOKEN", ); + let application_id: u64 = env::var("APPLICATION_ID").expect( + "Could not find an application ID in the APPLICATION_ID environment variable, please provide one", + ).parse().expect("That wasn't a number"); + let http = Http::new_with_token(&token); let (owners, bot_id) = match http.get_current_application_info().await { @@ -123,6 +127,7 @@ pub async fn prepare_client(arguments: ArgMatches<'_> let client = Client::builder(&token) .event_handler(event_handler) + .application_id(application_id) .framework(framework) .await .expect("Error creating client!");