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

@@ -8,6 +8,7 @@ mod whois;
mod color;
mod name;
mod disown;
mod remove;
#[poise::command(
prefix_command,
@@ -18,13 +19,14 @@ mod disown;
"color::color",
"name::name",
"disown::disown",
"remove::remove",
)
)]
pub async fn role(_ctx: Context<'_>) -> Result<(), Error> {
Ok(())
}
pub async fn get_user_role(_ctx: Context<'_>, user: UserId, guild: GuildId, db: &mut PgConnection) -> Result<Option<RoleId>, Error> {
pub async fn get_user_role(user: UserId, guild: GuildId, db: &mut PgConnection) -> Result<Option<RoleId>, Error> {
match sqlx::query("SELECT roleid FROM selfroles WHERE userid = $1 AND guildid = $2")
.bind(user.get() as i64)
.bind(guild.get() as i64)