Use message.cleanContent for webhooks to not ping

This commit is contained in:
Lamp 2019-08-08 12:21:02 -07:00 committed by GitHub
parent 1855a59468
commit 5cc091085c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -144,7 +144,7 @@ function createOWOPbridge(owopWorld, configDiscordChannels, password) {
let username = message.member && message.member.displayName || message.author.username;
if (message.guild) username += ' @ ' + message.guild.name;
if (username.length > 32) username = username.substring(0, 31) + '…';
discordChannel.webhook.send(message.content, {username, avatarURL: message.author.avatarURL})
discordChannel.webhook.send(message.cleanContent, {username, avatarURL: message.author.avatarURL})
.catch(error => {
console.error(`Failed to send Discord broadcast via webhook to discordChannel ${[discordChannel.id, '#'+discordChannel.name, discordChannel.guild.name]}:`, error.message);
// fallback to embed if webhook fails