implement pino poc

This commit is contained in:
JT2M0L3Y
2026-10-21 19:09:28 -07:00
parent 99db6d8163
commit 217291e531
22 changed files with 332 additions and 97 deletions
+5 -2
View File
@@ -1,5 +1,8 @@
import { Client, CommandInteraction, MessageFlags } from 'discord.js'
import { AdminCommand, SlashCommand } from '../utils/index.js'
import { createLogger } from '../components/index.js'
const logger = createLogger({ component: 'command', command: 'shutoff' })
export const Shutoff: SlashCommand = {
name: 'shutoff',
@@ -12,7 +15,7 @@ export const Shutoff: SlashCommand = {
if (!channel || !AdminCommand.includes(channel.type)) return
// log this, this will probably be improtant for logging who did this
console.log(`[Command: shutoff] User ${interaction.user.tag} attempting to shutdown ${client.user!!.tag}`)
logger.info({ actor: interaction.user.tag, bot: client.user!!.tag }, 'Shutdown requested')
// check if admin or false on shutdown
if (!interaction.memberPermissions?.has('Administrator')) {
@@ -29,7 +32,7 @@ export const Shutoff: SlashCommand = {
flags: MessageFlags.Ephemeral
})
console.log(`[Command: shutoff] ${client.user?.tag} is shutting down.`)
logger.info({ bot: client.user?.tag }, 'Bot is shutting down')
// clean up client instance and stop
client.destroy()