From f89857a4994a65c0f3e5eb4ac08dbe5b5fe78eb4 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sun, 28 Sep 2025 23:29:19 -0600 Subject: [PATCH] Add git info to about command --- how -s --format=-ci | 60 ++++++++++++++++++++++++++++++++++ interactions/commands/about.js | 5 +-- 2 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 how -s --format=-ci diff --git a/how -s --format=-ci b/how -s --format=-ci new file mode 100644 index 0000000..dab06e9 --- /dev/null +++ b/how -s --format=-ci @@ -0,0 +1,60 @@ +1759123202 + +diff --git a/commands.js b/commands.js +index 16a54fa..a1ec8f3 100644 +--- a/commands.js ++++ b/commands.js +@@ -148,6 +148,13 @@ const globalCommands = [ + type: 1 // SUB_COMMAND type + } + ] ++ }, ++ { ++ name: "about", ++ description: "Tell me about this bot", ++ type: 1, // CHAT_INPUT type, ++ integration_types: [0, 1], ++ contexts: [0, 1, 2] + } + ] +  +diff --git a/interactions/commands/about.js b/interactions/commands/about.js +new file mode 100644 +index 0000000..9ac3fa7 +--- /dev/null ++++ b/interactions/commands/about.js +@@ -0,0 +1,33 @@ ++const Discord = require('discord.js'); ++const { execSync } = require('child_process'); ++const gitHash = execSync('git rev-parse --short HEAD').toString().trim(); ++ ++const execute = async (interaction, db, client) => { ++ if (!interaction.isCommand()) return; ++ await interaction.reply({ ++ ephemeral: true, ++ embeds: [{ ++ title: "About Satanic Security", ++ description: "Satanic Security is designed to keep track of known bad actors and help server admins of vulnerable communities keep them out. This is an Open Source project, Licensed under the GPL-3.0 License.\n\n[The source code is available on Git](https://git.chrischro.me/ChrisChrome/satanic-security)", ++ color: 0x00FFFF, ++ fields: [ ++ { ++ name: "Lead Developer", ++ value: "<@289884287765839882> (@chrischrome)", ++ inline: true ++ }, ++ { ++ name: "Guilds using Satanic Security", ++ value: `${client.guilds.cache.size}`, ++ inline: true ++ }, ++ { ++ name: "Version", ++ value: `Git Commit: ${gitHash}`, ++ inline: true ++ } ++ ] ++ }] ++ }) ++} ++module.exports = { execute }; +\ No newline at end of file diff --git a/interactions/commands/about.js b/interactions/commands/about.js index 9ac3fa7..9708cf5 100644 --- a/interactions/commands/about.js +++ b/interactions/commands/about.js @@ -1,7 +1,8 @@ const Discord = require('discord.js'); const { execSync } = require('child_process'); const gitHash = execSync('git rev-parse --short HEAD').toString().trim(); - +const gitTimestamp = execSync(`git log -1 --pretty=format:"%ct"`).toString().trim(); +const gitCommiter = execSync(`git log -1 --pretty=format:"%cn <%ce>"`).toString().trim(); const execute = async (interaction, db, client) => { if (!interaction.isCommand()) return; await interaction.reply({ @@ -23,7 +24,7 @@ const execute = async (interaction, db, client) => { }, { name: "Version", - value: `Git Commit: ${gitHash}`, + value: `Git Commit ${gitHash} by ${gitCommiter} on `, inline: true } ]