disableEveryone -> disableMentions
damnit discord.js I got @everyone'd
This commit is contained in:
parent
b651317345
commit
56b017af28
|
@ -4,7 +4,7 @@ var WebSocket = require('ws');
|
||||||
var Discord = require('discord.js');
|
var Discord = require('discord.js');
|
||||||
var createWsMessageCollector = require('./datacollector');
|
var createWsMessageCollector = require('./datacollector');
|
||||||
|
|
||||||
var webhook = new Discord.WebhookClient(config.webhooks.ddp[0], config.webhooks.ddp[1], {disableEveryone:true});
|
var webhook = new Discord.WebhookClient(config.webhooks.ddp[0], config.webhooks.ddp[1], {disableMentions:'all'});
|
||||||
|
|
||||||
var ws;
|
var ws;
|
||||||
var wasConnected = false;
|
var wasConnected = false;
|
||||||
|
|
|
@ -4,7 +4,7 @@ if (config.testmode) console.log('TEST MODE');
|
||||||
global.exitHook = require('async-exit-hook');
|
global.exitHook = require('async-exit-hook');
|
||||||
global.Discord = require('discord.js');
|
global.Discord = require('discord.js');
|
||||||
global.fs = require('fs');
|
global.fs = require('fs');
|
||||||
global.dClient = new Discord.Client({ disableEveryone: true });
|
global.dClient = new Discord.Client({ disableMentions: 'all' });
|
||||||
|
|
||||||
// error handling
|
// error handling
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
var webhook = new Discord.WebhookClient(config.webhooks.welcome[0], config.webhooks.welcome[1]);
|
var webhook = new Discord.WebhookClient(config.webhooks.welcome[0], config.webhooks.welcome[1]);
|
||||||
dClient.on('local_guildMemberAdd', async member => {
|
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;
|
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}), disableEveryone:true});
|
webhook.send(`${member} joined.`, {username, avatarURL: member.user.displayAvatarURL({format:'png',size:2048}), disableMentions:'all'});
|
||||||
});
|
});
|
||||||
dClient.on('local_guildMemberRemove', async member => {
|
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;
|
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}), disableEveryone:true});
|
webhook.send(`${member.user.tag} left.`, {username, avatarURL: member.user.displayAvatarURL({format:'png',size:2048}), disableMentions:'all'});
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ global.clients = {};
|
||||||
global.createMPPbridge = function createMPPbridge(room, DiscordChannelID, site = 'MPP', webhookID, webhookToken) {
|
global.createMPPbridge = function createMPPbridge(room, DiscordChannelID, site = 'MPP', webhookID, webhookToken) {
|
||||||
var DiscordChannel = dClient.channels.resolve(DiscordChannelID);
|
var DiscordChannel = dClient.channels.resolve(DiscordChannelID);
|
||||||
if (!DiscordChannel) return console.error(`Couldn't bridge ${site} ${room} because Discord Channel ${DiscordChannelID} is missing!`);
|
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, {disableEveryone:true});
|
if (webhookID && webhookToken) var webhook = new Discord.WebhookClient(webhookID, webhookToken, {disableMentions:'all'});
|
||||||
|
|
||||||
|
|
||||||
// discord message sending
|
// discord message sending
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
username: `${m.u.username} @ fookat.tk`.substr(0,32),
|
username: `${m.u.username} @ fookat.tk`.substr(0,32),
|
||||||
avatarURL: `https://fookat.tk/avatar/${m.u.username}?${process.pid}`,
|
avatarURL: `https://fookat.tk/avatar/${m.u.username}?${process.pid}`,
|
||||||
split: true,
|
split: true,
|
||||||
disableEveryone: true,
|
disableMentions: 'all',
|
||||||
embeds: m.attachments ? m.attachments.map(a => ({
|
embeds: m.attachments ? m.attachments.map(a => ({
|
||||||
title: a.title,
|
title: a.title,
|
||||||
url: a.title_link ? "https://fookat.tk" + a.title_link : undefined,
|
url: a.title_link ? "https://fookat.tk" + a.title_link : undefined,
|
||||||
|
|
Loading…
Reference in New Issue