From ffad5441f4d21ac7d6e1187b9749c687b7a9df87 Mon Sep 17 00:00:00 2001 From: Lucy Bladen Date: Tue, 12 Jul 2022 02:02:15 +0100 Subject: [PATCH] Realign serenity version --- src/events.rs | 4 ++-- src/lib.rs | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/events.rs b/src/events.rs index e227ca4..7668836 100644 --- a/src/events.rs +++ b/src/events.rs @@ -34,14 +34,14 @@ impl Handler { }; let greeting = match responses.get_response(&"bot startup".to_string()) { - Some(g) => g.replace("{NAME}", &*ctx.cache.current_user().await.name).replace("{COFFEE_TYPE}", "espresso").to_string(), + Some(g) => g.replace("{NAME}", &*ctx.cache.current_user().name).replace("{COFFEE_TYPE}", "espresso").to_string(), None => "Manifold bot connected to discord and ready to begin broadcast operations.".to_string(), }; let bot_nickname = config.get_value(&"BotNickname".to_string()).map(|n| n.as_str()); let channel: ChannelId = config.get_channel(&"Log".to_string()); for guild in data_about_bot.guilds { - match guild.id().edit_nickname(&ctx, bot_nickname).await { + match guild.id.edit_nickname(&ctx, bot_nickname).await { Ok(()) => (), Err(e) => { error!("Error setting bot nickname (lack permission?): {:?}", e); diff --git a/src/lib.rs b/src/lib.rs index acfa0ff..4e070e7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -103,21 +103,20 @@ pub async fn prepare_client(arguments: ArgMatches, mu "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 http = Http::new(&token); - let (owners, bot_id) = match http.get_current_application_info().await { + let owners = match http.get_current_application_info().await { Ok(info) => { let mut owners = HashSet::new(); owners.insert(info.owner.id); - (owners, info.id) + owners } Err(why) => panic!("Could not get HTTP application information - exiting: {:?}", why), }; framework = framework.configure(|c| c .with_whitespace(true) - .on_mention(Some(bot_id)) .prefix(&prefix) .owners(owners) .case_insensitivity(true) @@ -125,7 +124,7 @@ pub async fn prepare_client(arguments: ArgMatches, mu .help(&MANIFOLD_HELP); framework.group_add(&CORE_GROUP); - let client = Client::builder(&token) + let client = Client::builder(&token, GatewayIntents::default()) .event_handler(event_handler) .application_id(application_id) .framework(framework)