Last active
November 12, 2018 08:06
-
-
Save acollierr17/28e48772df400c5cba3150065bf9ea8b to your computer and use it in GitHub Desktop.
Troll your friend! Every time they delete a message, the bot will repost their message in the channel.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Client } = require('discord.js'); | |
const client = new Client({ disableEveryone: true }); | |
const yourFriend = '158063324699951104'; // User ID for the friend you want to troll | |
client.on('ready', () => console.log(`Logged in as ${client.user.tag} (${client.user.id}) in ${client.guilds.size} server(s).`)); | |
client.on('message', async message => { | |
// This is here because I want to ignore any messages being sent. Only want to focus on the "messageDelete" event | |
if (message.author.bot) return; | |
if (message.member) return; | |
}); | |
client.on('messageDelete', async message => { | |
if (!message.guild) return; | |
if (message.author.id !== yourFriend) return; | |
let msg = await message; | |
message.channel.send(`${message.author} deleted: **${msg.content}**`); | |
}); | |
client.login('no u'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment