Add info message

This commit is contained in:
Aadi Desai 2023-09-24 16:09:52 +01:00
parent 2f7ddf660f
commit ff654533e7
Signed by: supleed2
SSH key fingerprint: SHA256:CkbNRs0yVzXEiUp2zd0PSxsfRUMFF9bLlKXtE1xEbKM
2 changed files with 21 additions and 0 deletions

View file

@ -180,6 +180,7 @@ async fn event_handler(
match m.data.custom_id.as_str() {
"register.global" | "unregister.global" | "register.guild" | "unregister.guild" => {
}
"info" => verify::info(ctx, m).await?,
"start" => verify::start(ctx, m, data, true).await?,
"restart" => verify::start(ctx, m, data, false).await?,
"login_1" => verify::login_1(ctx, m).await?,

View file

@ -10,6 +10,26 @@ pub(crate) use membership::*;
pub(crate) mod manual;
pub(crate) use manual::*;
const INFO_MSG: &str = indoc::indoc! {"
Nano is a Discord bot written with serenity-rs/poise and tokio-rs/axum.
It allows members and Imperial students to automatically verify themselves and gain access to the ICAS Discord server.
If you have any questions, feel free to ping or message <@99217900254035968>
"};
pub(crate) async fn info(
ctx: &serenity::Context,
m: &serenity::MessageComponentInteraction,
) -> Result<(), Error> {
m.create_interaction_response(&ctx.http, |i| {
i.kind(serenity::InteractionResponseType::ChannelMessageWithSource)
.interaction_response_data(|d| d.content(INFO_MSG).ephemeral(true))
})
.await?;
Ok(())
}
pub(crate) async fn unknown(
ctx: &serenity::Context,
m: &serenity::MessageComponentInteraction,