Compare commits
6 Commits
e61f8aec21
...
8a52ab5783
| Author | SHA1 | Date |
|---|---|---|
|
|
8a52ab5783 | |
|
|
ea81778099 | |
|
|
4cb966c038 | |
|
|
a97460d739 | |
|
|
a64f66cc7a | |
|
|
54bd863934 |
|
|
@ -1,7 +1,6 @@
|
|||
use manifold::error::{ManifoldError, ManifoldResult};
|
||||
use manifold::{ManifoldContext, ManifoldData};
|
||||
use poise::serenity_prelude as serenity;
|
||||
use crate::badgey::models::quarantine_channel::QuarantineChannel;
|
||||
|
||||
#[poise::command(slash_command, prefix_command, required_permissions = "MODERATE_MEMBERS")]
|
||||
async fn void_user(_ctx: ManifoldContext<'_>, _target: serenity::User) -> ManifoldResult<()> {
|
||||
|
|
@ -23,6 +22,18 @@ async fn record_chronicle(_ctx: ManifoldContext<'_>, _target: serenity::User) ->
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[poise::command(slash_command, prefix_command, required_permissions = "MODERATE_MEMBERS", aliases("sr", "sl"))]
|
||||
async fn security_record(ctx: ManifoldContext<'_>) -> ManifoldResult<()> {
|
||||
|
||||
let author = ctx.author().id;
|
||||
let timestamp = chrono::Utc::now().timestamp();
|
||||
let response_body = format!("```**__Server Security Report__**\n\n**Date:** <t:{timestamp}:f>\n**Moderator(s):** <@{author}>\n**Offending User(s):**\n\n**Description:**\n\n**Actions Taken:**```", timestamp = timestamp, author = author);
|
||||
|
||||
ctx.reply(response_body).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[poise::command(slash_command, prefix_command, required_permissions = "MANAGE_GUILD")]
|
||||
async fn add_quarantine_channel(ctx: ManifoldContext<'_>, channel: serenity::ChannelId, role: serenity::RoleId) -> ManifoldResult<()> {
|
||||
let qc = QuarantineChannel::new(role.as_u64().clone() as i64, channel.as_u64().clone() as i64);
|
||||
|
|
@ -42,6 +53,6 @@ async fn remove_quarantine_channel(ctx: ManifoldContext<'_>, channel: serenity::
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn commands() -> [poise::Command<ManifoldData, ManifoldError>; 6] {
|
||||
[void_user(), unvoid_user(), airlock_user(), record_chronicle(), add_quarantine_channel(), remove_quarantine_channel()]
|
||||
pub fn commands() -> [poise::Command<ManifoldData, ManifoldError>; 7] {
|
||||
[void_user(), unvoid_user(), airlock_user(), record_chronicle(), security_record(), add_quarantine_channel(), remove_quarantine_channel()]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue