no wonder user mentions weren't working
This commit is contained in:
Lamp 2020-04-18 13:00:53 -07:00
parent bf6e7fad5e
commit ccdfe465a3
5 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@ var WebSocket = require('ws');
var Discord = require('discord.js');
var createWsMessageCollector = require('./datacollector');
var webhook = new Discord.WebhookClient(config.webhooks.ddp[0], config.webhooks.ddp[1], {disableMentions:'all'});
var webhook = new Discord.WebhookClient(config.webhooks.ddp[0], config.webhooks.ddp[1], {disableMentions:'everyone'});
var ws;
var wasConnected = false;

View File

@ -4,7 +4,7 @@ if (config.testmode) console.log('TEST MODE');
global.exitHook = require('async-exit-hook');
global.Discord = require('discord.js');
global.fs = require('fs');
global.dClient = new Discord.Client({ disableMentions: 'all' });
global.dClient = new Discord.Client({ disableMentions: 'everyone' });
// error handling
{

View File

@ -3,11 +3,11 @@
var webhook = new Discord.WebhookClient(config.webhooks.welcome[0], config.webhooks.welcome[1]);
dClient.on('local_guildMemberAdd', async member => {
let username = member.user.username.toLowerCase().includes('clyde') ? member.user.username.replace(/C/g,'Q').replace(/c/g,'q') : member.user.username;
webhook.send(`${member} joined.`, {username, avatarURL: member.user.displayAvatarURL({format:'png',size:2048}), disableMentions:'all'});
webhook.send(`${member} joined.`, {username, avatarURL: member.user.displayAvatarURL({format:'png',size:2048}), disableMentions:'everyone'});
});
dClient.on('local_guildMemberRemove', async member => {
let username = member.user.username.toLowerCase().includes('clyde') ? member.user.username.replace(/C/g,'Q').replace(/c/g,'q') : member.user.username;
webhook.send(`${member.user.tag} left.`, {username, avatarURL: member.user.displayAvatarURL({format:'png',size:2048}), disableMentions:'all'});
webhook.send(`${member.user.tag} left.`, {username, avatarURL: member.user.displayAvatarURL({format:'png',size:2048}), disableMentions:'everyone'});
});
})();

View File

@ -4,7 +4,7 @@ global.clients = {};
global.createMPPbridge = function createMPPbridge(room, DiscordChannelID, site = 'MPP', webhookID, webhookToken) {
var DiscordChannel = dClient.channels.resolve(DiscordChannelID);
if (!DiscordChannel) return console.error(`Couldn't bridge ${site} ${room} because Discord Channel ${DiscordChannelID} is missing!`);
if (webhookID && webhookToken) var webhook = new Discord.WebhookClient(webhookID, webhookToken, {disableMentions:'all'});
if (webhookID && webhookToken) var webhook = new Discord.WebhookClient(webhookID, webhookToken, {disableMentions:'everyone'});
// discord message sending

View File

@ -95,7 +95,7 @@
username: `${m.u.username} @ fookat.tk`.substr(0,32),
avatarURL: `https://fookat.tk/avatar/${m.u.username}?${process.pid}`,
split: true,
disableMentions: 'all',
disableMentions: 'everyone',
embeds: m.attachments ? m.attachments.map(a => ({
title: a.title,
url: a.title_link ? "https://fookat.tk" + a.title_link : undefined,