Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

feat: cure slash command #72

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/commands/moderation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use chrono::Utc;
use mongodb::options::{UpdateModifications, UpdateOptions};
use poise::serenity_prelude::{
self as serenity,
Member,
Mentionable,
PermissionOverwrite,
Permissions,
Expand All @@ -12,6 +13,7 @@ use tracing::{debug, error, trace};

use crate::db::model::{LockedChannel, Muted};
use crate::utils::bot::get_member;
use crate::utils::decancer::cure as cure_member;
use crate::utils::macros::to_user;
use crate::utils::moderation::{
ban_moderation,
Expand Down Expand Up @@ -469,3 +471,13 @@ async fn handle_ban(ctx: &Context<'_>, kind: &BanKind) -> Result<(), Error> {
)
.await
}

/// Cure a member.
#[poise::command(slash_command)]
pub async fn cure(
ctx: Context<'_>,
#[description = "The member to cure"] member: Member,
) -> Result<(), Error> {
cure_member(ctx.serenity_context(), &None, &member).await;
Ok(())
}
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async fn main() {
moderation::unban(),
moderation::lock(),
moderation::unlock(),
moderation::cure(),
misc::reply(),
misc::poll(),
];
Expand Down