Eselfins
Eselfins
DIAdiscord.js - Imagine an app
Created by Eselfins on 10/14/2024 in #djs-questions
Activity isn`t showing
No description
10 replies
DIAdiscord.js - Imagine an app
Created by Eselfins on 10/14/2024 in #djs-questions
Is there a way to save deleted messages and use them in transcript?
const fs = require('fs');
const path = require('path');

async function generateTranscript(channel) {
const messages = await channel.messages.fetch({ limit: 100 });
const sortedMessages = messages.sort((a, b) => a.createdTimestamp - b.createdTimestamp);
const transcript = sortedMessages.map(msg => {
const date = new Date(msg.createdTimestamp);
const moscowTime = date.toLocaleString('ru-RU', { timeZone: 'Europe/Moscow' });
return `*${moscowTime}* - **${msg.author.tag}**: ${msg.content}`;
}).join('\n---\n');
const fileName = `${channel.name}-${channel.topic.match(/<@(\d+)>/)[1]}.txt`;
const filePath = path.join(__dirname, '../transcripts', fileName);

fs.writeFileSync(filePath, transcript);
return filePath;
}

module.exports = { generateTranscript };
const fs = require('fs');
const path = require('path');

async function generateTranscript(channel) {
const messages = await channel.messages.fetch({ limit: 100 });
const sortedMessages = messages.sort((a, b) => a.createdTimestamp - b.createdTimestamp);
const transcript = sortedMessages.map(msg => {
const date = new Date(msg.createdTimestamp);
const moscowTime = date.toLocaleString('ru-RU', { timeZone: 'Europe/Moscow' });
return `*${moscowTime}* - **${msg.author.tag}**: ${msg.content}`;
}).join('\n---\n');
const fileName = `${channel.name}-${channel.topic.match(/<@(\d+)>/)[1]}.txt`;
const filePath = path.join(__dirname, '../transcripts', fileName);

fs.writeFileSync(filePath, transcript);
return filePath;
}

module.exports = { generateTranscript };
19 replies
DIAdiscord.js - Imagine an app
Created by Eselfins on 10/14/2024 in #djs-questions
Log error
I`m trying to log new ticket creation by using this code
18 replies
DIAdiscord.js - Imagine an app
Created by Eselfins on 10/11/2024 in #djs-questions
Is there a way to read users bio?
I want to add a function that checks users bio for links
10 replies