feat: add ask for new meme and init list
This commit is contained in:
parent
e9cb9ed211
commit
4fb0174c99
21
src/bot/cmd/meme/ask.rs
Normal file
21
src/bot/cmd/meme/ask.rs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
use serenity::{
|
||||||
|
all::Message,
|
||||||
|
client::Context,
|
||||||
|
framework::standard::{macros::command, CommandResult},
|
||||||
|
};
|
||||||
|
|
||||||
|
#[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
|
||||||
|
{
|
||||||
|
println!("Error sending message: {:?}", why)
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
use super::{answer::ANSWER_COMMAND, enable::ENABLE_COMMAND};
|
use super::{answer::ANSWER_COMMAND, ask::ASK_COMMAND, enable::ENABLE_COMMAND, list::LIST_COMMAND};
|
||||||
use serenity::all::standard::macros::group;
|
use serenity::all::standard::macros::group;
|
||||||
|
|
||||||
// Include the meme commands
|
// Include the meme commands
|
||||||
@ -10,6 +10,6 @@ use serenity::all::standard::macros::group;
|
|||||||
#[prefixes("meme", "m")]
|
#[prefixes("meme", "m")]
|
||||||
#[summary = "Meme related commands"]
|
#[summary = "Meme related commands"]
|
||||||
#[description = "Commands to handle the meme related stuffs, it allow you to enable/disable the meme answer or to trigger a one time meme answer."]
|
#[description = "Commands to handle the meme related stuffs, it allow you to enable/disable the meme answer or to trigger a one time meme answer."]
|
||||||
#[commands(enable, answer)]
|
#[commands(enable, answer, ask, list)]
|
||||||
#[default_command(answer)]
|
#[default_command(answer)]
|
||||||
pub struct Meme;
|
pub struct Meme;
|
||||||
|
21
src/bot/cmd/meme/list.rs
Normal file
21
src/bot/cmd/meme/list.rs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
use serenity::{
|
||||||
|
all::Message,
|
||||||
|
client::Context,
|
||||||
|
framework::standard::{macros::command, CommandResult},
|
||||||
|
};
|
||||||
|
|
||||||
|
#[command]
|
||||||
|
#[description = "List supported meme keywords"]
|
||||||
|
pub async fn list(ctx: &Context, msg: &Message) -> CommandResult {
|
||||||
|
if let Err(why) = msg
|
||||||
|
.channel_id
|
||||||
|
.say(
|
||||||
|
&ctx.http,
|
||||||
|
"Soon TM - List of supported meme keywords will be available here.",
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
println!("Error sending message: {:?}", why)
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
@ -1,3 +1,5 @@
|
|||||||
pub mod answer;
|
pub mod answer;
|
||||||
|
pub mod ask;
|
||||||
pub mod enable;
|
pub mod enable;
|
||||||
pub mod init;
|
pub mod init;
|
||||||
|
pub mod list;
|
||||||
|
Loading…
Reference in New Issue
Block a user