chore: Ajout du transcript fonctionnel pour les tickets

This commit is contained in:
UltraLionFr
2025-08-26 14:41:28 +02:00
parent bb22e65117
commit 4f1a0379ea
21 changed files with 778 additions and 41 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ const logger = require('../../handlers/logger');
module.exports = {
name: 'clientReady',
once: true,
async execute(client) {
async execute() {
const commands = getCommandsJSON();
const rest = new REST({ version: '10' }).setToken(
process.env.DISCORD_TOKEN
+34
View File
@@ -0,0 +1,34 @@
const fs = require('fs');
const path = require('path');
const express = require('express');
module.exports = {
name: 'clientReady',
once: true,
async execute() {
const app = express();
const transcriptsPath = path.join(__dirname, '../../transcripts');
app.use('/transcript', express.static(transcriptsPath));
app.get('/', (req, res) => {
res.send(
'✅ Serveur Transcript actif. Utilise /transcript/:id pour voir un ticket.'
);
});
app.get('/transcript/:id', (req, res) => {
const file = path.join(transcriptsPath, `${req.params.id}.html`);
if (fs.existsSync(file)) {
res.sendFile(file);
} else {
res.status(404).send('❌ Transcript introuvable');
}
});
const PORT = process.env.TRANSCRIPT_PORT || 3000;
app.listen(PORT, () => {
console.log(`🌐 Serveur Transcript dispo sur http://localhost:${PORT}`);
});
},
};