Add about command and bump version

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/6/head
trivernis 3 years ago
parent 57292b2a5e
commit 255e11833b
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

2
Cargo.lock generated

@ -2269,7 +2269,7 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tobi-rs"
version = "0.2.0"
version = "0.2.1"
dependencies = [
"aspotify",
"chrono",

@ -1,6 +1,6 @@
[package]
name = "tobi-rs"
version = "0.2.0"
version = "0.2.1"
authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018"

@ -0,0 +1,24 @@
use serenity::client::Context;
use serenity::framework::standard::macros::command;
use serenity::framework::standard::CommandResult;
use serenity::model::channel::Message;
#[command]
#[description("Displays information about the bot")]
async fn about(ctx: &Context, msg: &Message) -> CommandResult {
msg.channel_id
.send_message(ctx, |m| {
m.embed(|e| {
e.title("About").description(format!(
"\
I'm a general purpose discord bot written in rusty Rust. \
My main focus is providing information about all kinds of stuff and playing music.\
Use `{}help` to get an overview of the commands I provide.",
std::env::var("BOT_PREFIX").unwrap()
))
})
})
.await?;
Ok(())
}

@ -8,6 +8,7 @@ use shutdown::SHUTDOWN_COMMAND;
use stats::STATS_COMMAND;
use time::TIME_COMMAND;
use timezones::TIMEZONES_COMMAND;
use about::ABOUT_COMMAND;
pub(crate) mod help;
mod pekofy;
@ -18,7 +19,8 @@ mod shutdown;
mod stats;
mod time;
mod timezones;
mod about;
#[group]
#[commands(ping, stats, shutdown, pekofy, time, timezones, qalc, sauce)]
#[commands(ping, stats, shutdown, pekofy, time, timezones, qalc, sauce, about)]
pub struct Misc;

Loading…
Cancel
Save