From ff654533e7578e2b88c8d418af63d54dc00c18a9 Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Sun, 24 Sep 2023 16:09:52 +0100 Subject: [PATCH] Add info message --- src/main.rs | 1 + src/verify/mod.rs | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/main.rs b/src/main.rs index a50f16f..cb94660 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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?, diff --git a/src/verify/mod.rs b/src/verify/mod.rs index 9e9f307..bceb965 100644 --- a/src/verify/mod.rs +++ b/src/verify/mod.rs @@ -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,