refactor!: use poise 0.6.1

This commit is contained in:
seth 2024-01-27 22:29:56 -05:00
parent 203ba111cc
commit 7252ced3cb
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
16 changed files with 700 additions and 512 deletions

View file

@ -1,6 +1,8 @@
use crate::{consts::COLORS, Context};
use crate::{consts, Context};
use color_eyre::eyre::{Context as _, Result};
use poise::serenity_prelude::CreateEmbed;
use poise::CreateReply;
/// Returns GitHub stargazer count
#[poise::command(slash_command, prefix_command)]
@ -19,13 +21,12 @@ pub async fn stars(ctx: Context<'_>) -> Result<()> {
"undefined".to_string()
};
ctx.send(|m| {
m.embed(|e| {
e.title(format!("{count} total stars!"))
.color(COLORS["yellow"])
})
})
.await?;
let embed = CreateEmbed::new()
.title(format!("{count} total stars!"))
.color(consts::COLORS["yellow"]);
let reply = CreateReply::default().embed(embed);
ctx.send(reply).await?;
Ok(())
}