mirror of
https://github.com/Noratrieb/widetom.git
synced 2026-03-15 05:46:04 +01:00
serenity 0.10->0.11
This commit is contained in:
parent
893d109fda
commit
5cebd44efd
4 changed files with 216 additions and 241 deletions
|
|
@ -4,7 +4,7 @@ use lazy_static::lazy_static;
|
|||
use rand::Rng;
|
||||
use serenity::client::Context;
|
||||
use serenity::framework::standard::{Args, CommandGroup, CommandResult, help_commands, HelpOptions, macros::{command, group, help}};
|
||||
use serenity::model::{channel::Message};
|
||||
use serenity::model::channel::Message;
|
||||
use serenity::model::id::UserId;
|
||||
use serenity::utils::{content_safe, ContentSafeOptions};
|
||||
use toml::Value;
|
||||
|
|
@ -58,7 +58,7 @@ async fn say(ctx: &Context, msg: &Message, args: Args) -> CommandResult {
|
|||
.clean_role(false)
|
||||
};
|
||||
|
||||
let content = content_safe(&ctx.cache, &args.rest(), &settings).await;
|
||||
let content = content_safe(&ctx.cache, &args.rest(), &settings, &[]);
|
||||
msg.delete(&ctx.http).await?;
|
||||
msg.channel_id.say(&ctx.http, &content).await?;
|
||||
Ok(())
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ async fn main() {
|
|||
let token = fs::read_to_string(token_path).expect("Expected bot token in file 'bot_token'");
|
||||
let token = token.trim();
|
||||
|
||||
let http = Http::new_with_token(&token);
|
||||
let http = Http::new(&token);
|
||||
|
||||
http.get_current_application_info()
|
||||
.await
|
||||
|
|
@ -61,7 +61,9 @@ async fn main() {
|
|||
.group(&MEME_GROUP)
|
||||
.group(&ADMIN_GROUP);
|
||||
|
||||
let mut client = Client::builder(&token)
|
||||
// We don't really need all intents, but this is a small bot so we don't care.
|
||||
let intents = GatewayIntents::all();
|
||||
let mut client = Client::builder(&token, intents)
|
||||
.event_handler(Handler)
|
||||
.framework(framework)
|
||||
.await
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue