Update EXAMPLE.env, install.sh, and 2 more files...

This commit is contained in:
2024-02-05 16:42:50 -05:00
commit 8d65a162c4
4 changed files with 37 additions and 0 deletions

26
main.js Normal file
View File

@@ -0,0 +1,26 @@
require('dotenv').config();
const { Client } = require('discord.js-selfbot-v13');
const client = new Client();
const SOURCE_CHANNEL_ID = process.env.SOURCE_CHANNEL_ID;
const TARGET_CHANNEL_ID = process.env.TARGET_CHANNEL_ID;
client.on('ready', () => {
console.log(`${client.user.tag} is ready!`);
});
client.on('messageCreate', async message => {
if (message.channel.id === SOURCE_CHANNEL_ID) {
if (message.author.id === client.user.id) return;
const targetChannel = await client.channels.fetch(TARGET_CHANNEL_ID);
if (!targetChannel) {
console.error('Target channel not found');
return;
}
targetChannel.send(`<@${message.author.id}> / **${message.author.tag}**: ${message.content}`);
}
});
client.login(process.env.DISCORD_TOKEN);