Realign serenity version

This commit is contained in:
Lucy Bladen 2022-07-12 02:02:15 +01:00
parent f5246bd5fd
commit ffad5441f4
Signed by untrusted user who does not match committer: xyon
GPG Key ID: DD18155D6B18078D
2 changed files with 6 additions and 7 deletions

View File

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

View File

@ -103,21 +103,20 @@ pub async fn prepare_client<T: 'static + EventHandler>(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<T: 'static + EventHandler>(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)