aboutsummaryrefslogtreecommitdiff
path: root/src/commands/meta.rs
blob: c77f0489406bb166abcf4a1fdb90d4efb75955a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
use crate::{Context, Error};
use poise::serenity_prelude::{self as serenity, Activity};

/// Pings the bot
#[poise::command(prefix_command, slash_command)]
pub async fn ping(ctx: Context<'_>) -> Result<(), Error> {
    ctx.say("Pong!").await?;

    Ok(())
}

/// Shows information about the bot
#[poise::command(prefix_command, slash_command)]
pub async fn about(ctx: Context<'_>) -> Result<(), Error> {
    let current_version = env!("CARGO_PKG_VERSION");

    if let Err(e) = ctx
        .send(|m| {
            m.embed(|e| {
                e.title("Glitch");
                e.description("A pony who just wants to help out!");

                e.field("Creator", "<@118455061222260736>", true);
                e.field("Avatar", "<@678816040146436117>", true);
                e.field("Action GIFs", "<@678816040146436117>", true);
                e.field("Support the author!", "https://ko-fi.com/muirrum", false);

                e.footer(|f| {
                    f.text(format!("Running version: {}", current_version))
                })
            })
        })
        .await
    {
        return Err(e.into());
    }

    Ok(())
}

#[poise::command(prefix_command, slash_command, context_menu_command = "User Info")]
pub async fn userinfo(
    ctx: Context<'_>,
    #[description = "The user to get info on"] user: serenity::User,
) -> Result<(), Error> {
    Ok(())
}

#[poise::command(prefix_command, slash_command, owners_only, hide_in_help)]
pub async fn set_status(
    ctx: Context<'_>,
    #[description = "Custom game to play"]
    game: String,
    ) -> Result<(), Error> {
      ctx.discord().set_activity(Activity::playing(game)).await;

      Ok(())
}