Created
May 7, 2017 19:24
-
-
Save xetrics/1565d9ba28e1b429f10da152455bae8d to your computer and use it in GitHub Desktop.
discord image bomb
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 Discord = require("discord.js") | |
const fs = require("fs") | |
const path = require("path") | |
if(process.argv.length <= 3) { | |
console.log(`Usage: ${__filename} DISCORD_TOKEN /path/to/shibes`) | |
return | |
} | |
const bot = new Discord.Client() | |
bot.login(process.argv[2]) | |
bot.on("ready", () => { | |
console.log("ready ;333333333") | |
}) | |
bot.on("message", (msg) => { | |
if(msg.author.id != bot.user.id || !msg.content.startsWith("!shibastrike") || msg.mentions.users.size < 1) return | |
msg.delete() | |
fs.readdirSync(process.argv[3]).forEach((file) => { | |
if(!fs.statSync(path.join(process.argv[3], file)).isFile()) return | |
msg.mentions.users.first().send("", { | |
file: path.join(process.argv[3], file) | |
}) | |
}) | |
}) |
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
{ | |
"name": "shibastrike", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"discord.js": "^11.1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment