This commit is contained in:
nora 2021-06-01 20:00:06 +02:00
parent f66e2b9798
commit 4430cfe259
2 changed files with 18 additions and 3 deletions

View file

@ -10,11 +10,11 @@ use serenity::utils::{content_safe, ContentSafeOptions};
use toml::Value;
use uwuifier::uwuify_str_sse;
use crate::general::{CONFIG, CONFIG_ERR, reply};
use crate::general::{REACTION_EMOTES, CONFIG, CONFIG_ERR, reply};
use crate::LastMessageInChannel;
#[group]
#[commands(say)]
#[commands(say, list)]
#[description = "General widetom commands"]
struct General;
@ -30,6 +30,21 @@ struct Meme;
struct Admin;
#[command]
#[description("lists all the commands")]
async fn list(ctx: &Context, msg: &Message, _: Args) -> CommandResult {
msg.channel_id.send_message(&ctx.http, |msg| {
msg.embed(|e| {
e.title("Widetom reaction emotes");
e.fields(REACTION_EMOTES.iter()
.map(|em| (em.0, format!("<:{}:{}>", em.0, em.1.0), false))
);
e
})
}).await?;
Ok(())
}
#[command]
#[description("say something")]
async fn say(ctx: &Context, msg: &Message, args: Args) -> CommandResult {

View file

@ -19,7 +19,7 @@ lazy_static! {
config.parse::<Value>().expect(CONFIG_ERR)
};
static ref REACTION_EMOTES: HashMap<String, EmojiId> = {
pub static ref REACTION_EMOTES: HashMap<String, EmojiId> = {
let mut m = HashMap::new();
let emotes = CONFIG.get("emotes").expect(CONFIG_ERR);