From 54bd863934b7872b2830229c11646c419e630d18 Mon Sep 17 00:00:00 2001 From: Xyon Date: Sat, 12 Oct 2024 17:24:11 +0100 Subject: [PATCH 1/3] Reimplement 'sr' helper command --- src/badgey/commands/moderation.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/badgey/commands/moderation.rs b/src/badgey/commands/moderation.rs index e4fe75a..cff3073 100644 --- a/src/badgey/commands/moderation.rs +++ b/src/badgey/commands/moderation.rs @@ -1,6 +1,8 @@ +use built::chrono; use manifold::error::{ManifoldError, ManifoldResult}; use manifold::{ManifoldContext, ManifoldData}; use poise::serenity_prelude as serenity; +use crate::badgey::schema::custom_responses::response; #[poise::command(slash_command, prefix_command, required_permissions = "MODERATE_MEMBERS")] async fn void_user(_ctx: ManifoldContext<'_>, _target: serenity::User) -> ManifoldResult<()> { @@ -22,6 +24,18 @@ async fn record_chronicle(_ctx: ManifoldContext<'_>, _target: serenity::User) -> Ok(()) } -pub fn commands() -> [poise::Command; 4] { - [void_user(), unvoid_user(), airlock_user(), record_chronicle()] +#[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:** \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(()) +} + +pub fn commands() -> [poise::Command; 5] { + [void_user(), unvoid_user(), airlock_user(), record_chronicle(), security_record()] } From a64f66cc7a6ad5f195ecff07aec49ef7bd2e6b6d Mon Sep 17 00:00:00 2001 From: Xyon Date: Sat, 12 Oct 2024 17:25:09 +0100 Subject: [PATCH 2/3] Remove unused include --- src/badgey/commands/moderation.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/badgey/commands/moderation.rs b/src/badgey/commands/moderation.rs index cff3073..7352db6 100644 --- a/src/badgey/commands/moderation.rs +++ b/src/badgey/commands/moderation.rs @@ -2,7 +2,6 @@ use built::chrono; use manifold::error::{ManifoldError, ManifoldResult}; use manifold::{ManifoldContext, ManifoldData}; use poise::serenity_prelude as serenity; -use crate::badgey::schema::custom_responses::response; #[poise::command(slash_command, prefix_command, required_permissions = "MODERATE_MEMBERS")] async fn void_user(_ctx: ManifoldContext<'_>, _target: serenity::User) -> ManifoldResult<()> { From 4cb966c038859920339bdff640f6733159949623 Mon Sep 17 00:00:00 2001 From: Xyon Date: Sat, 12 Oct 2024 18:38:36 +0100 Subject: [PATCH 3/3] Add missing closing square bracket --- .gitea/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 9b97448..d272536 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -46,7 +46,7 @@ jobs: env: BOT_NICKNAME: ${{ vars[format('{0}_BOT_NICKNAME', matrix.bot)] }} BOT_IDENTIFIER: ${{ vars[format('{0}_SERVER_HOSTNAME', matrix.bot)] }} - LOG_CHANNEL_ID: ${{ vars[format('{0}_LOG_CHANNEL_ID', matrix.bot) }} + LOG_CHANNEL_ID: ${{ vars[format('{0}_LOG_CHANNEL_ID', matrix.bot)] }} POSTGRES_HOST: ${{ vars.POSTGRES_HOST }} POSTGRES_USER: ${{ vars.POSTGRES_USER }} POSTGRES_DATABASE_NAME: ${{ vars[format('{0}_POSTGRES_DATABASE_NAME', matrix.bot)] }}