new role management commands, bug fix, table restructuring, better output

This commit is contained in:
2024-12-08 12:15:54 -05:00
parent 8f764a2270
commit 0def108010
10 changed files with 97 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
use std::sync::Arc;
use tokio::sync::Mutex;
use std::collections::HashMap;
use poise::serenity_prelude::UserId;
use poise::{serenity_prelude::UserId, ReplyHandle};
use sqlx::PgConnection;
pub struct Data {
@@ -13,4 +13,16 @@ pub struct Data {
}
pub type Error = Box<dyn std::error::Error + Send + Sync>;
pub type Context<'a> = poise::Context<'a, Data, Error>;
pub type Context<'a> = poise::Context<'a, Data, Error>;
use poise::serenity_prelude::builder::CreateAllowedMentions;
use poise::CreateReply;
pub async fn no_ping_reply<'a>(ctx: &'a Context<'_>, text: impl Into<String>) -> Result<ReplyHandle<'a>, Error> {
Ok(ctx.send(
CreateReply::default()
.content(text.into())
.reply(true)
.allowed_mentions(CreateAllowedMentions::new())
).await?)
}