fix: prevent discord mention exploit

This commit is contained in:
Joe van der Zwet
2020-10-16 00:36:32 +13:00
parent 8f89f4b63f
commit 0776d33909

View File

@@ -4,6 +4,10 @@ export default function sendWebhook({webhookURL, message, options}){
let urlArray = webhookURL.split('/');
let token = urlArray.pop();
let id = urlArray.pop();
// prevent discord mention exploit
options.allowedMentions = { parse: [] };
const hook = new Discord.WebhookClient(id, token);
// Send a message using the webhook
hook.send(message, options)