feat!: first pass re-implementation of banner, gcal command

This commit is contained in:
2025-08-26 20:53:21 -05:00
parent 5018ad0d31
commit 31ab29c2f1
24 changed files with 2234 additions and 27 deletions
+16 -12
View File
@@ -1,16 +1,20 @@
use poise::serenity_prelude as serenity;
pub struct Data {} // User data, which is stored and accessible in all command invocations
use crate::app_state::AppState;
pub mod commands;
pub struct Data {
pub app_state: AppState,
} // User data, which is stored and accessible in all command invocations
pub type Error = Box<dyn std::error::Error + Send + Sync>;
pub type Context<'a> = poise::Context<'a, Data, Error>;
/// Displays your or another user's account creation date
#[poise::command(slash_command, prefix_command)]
pub async fn age(
ctx: Context<'_>,
#[description = "Selected user"] user: Option<serenity::User>,
) -> Result<(), Error> {
let u = user.as_ref().unwrap_or_else(|| ctx.author());
let response = format!("{}'s account was created at {}", u.name, u.created_at());
ctx.say(response).await?;
Ok(())
/// Get all available commands
pub fn get_commands() -> Vec<poise::Command<Data, Error>> {
vec![
commands::search(),
commands::terms(),
commands::time(),
commands::ics(),
commands::gcal(),
]
}