feat: turn ask into an embed message

This commit is contained in:
max 2024-02-11 23:37:53 +00:00
parent 89a107503f
commit e472930ade
2 changed files with 9 additions and 9 deletions

View File

@ -7,7 +7,7 @@ use serenity::model::prelude::{Message, UserId};
use std::collections::HashSet;
#[help]
#[individual_command_tip = "Hello! Pour plus d'information sur une commande, passer la en argument."]
#[individual_command_tip = "Hello! Pour plus d'information sur une commande, passe la en argument."]
#[command_not_found_text = "La commande `{}` n'a pas été trouver."]
#[max_levenshtein_distance(3)]
#[wrong_channel = "Strike"]

View File

@ -1,3 +1,4 @@
use serenity::builder::{CreateEmbed, CreateEmbedFooter, CreateMessage};
use serenity::{
all::Message,
client::Context,
@ -7,14 +8,13 @@ use serenity::{
#[command]
#[description = "Info to ask for new meme"]
pub async fn ask(ctx: &Context, msg: &Message) -> CommandResult {
if let Err(why) = msg
.channel_id
.say(
&ctx.http,
"Hi, if you want to add new meme to the bot, you need to ask batleforc to add new one. You can do it by sending a message to him.",
)
.await
{
let footer = CreateEmbedFooter::new("WeeboBot");
let embed = CreateEmbed::new()
.title("New meme ?")
.field("Hello, si tu souhaites ajouter un nouveau meme au bot, tu dois demander à batleforc d'en ajouter un nouveau. Tu peux le faire en lui envoyant un message.".to_string(), String::new(), true)
.footer(footer);
let builder = CreateMessage::new().embed(embed);
if let Err(why) = msg.channel_id.send_message(&ctx.http, builder).await {
println!("Error sending message: {:?}", why)
}
Ok(())