This commit is contained in:
Lamp 2022-01-03 21:31:34 -08:00
parent aba50ff519
commit 78c9e1e3b5
3 changed files with 5 additions and 4 deletions

View File

@ -2,7 +2,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({url: config.webhooks.ddp}); var webhook = new Discord.WebhookClient({url: config.webhooks.ddp, allowedMentions: {parse: []}});
var ws; var ws;
var wasConnected = false; var wasConnected = false;

View File

@ -7,12 +7,13 @@ global.Discord = require('discord.js');
global.fs = require('fs'); global.fs = require('fs');
global.dClient = new Discord.Client({ global.dClient = new Discord.Client({
intents: 32767, intents: 32767,
restRequestTimeout: 5*60*1000 restRequestTimeout: 5*60*1000,
allowedMentions: {parse: []}
}); });
// error handling // error handling
{ {
let webhook = new Discord.WebhookClient({url: config.webhooks.error}); let webhook = new Discord.WebhookClient({url: config.webhooks.error, allowedMentions: {parse: []}});
global.handleError = function logError(error, title) { global.handleError = function logError(error, title) {
let msg = error && (error.stack || error.message || error); let msg = error && (error.stack || error.message || error);
console.error(title + ':\n' + msg); console.error(title + ':\n' + msg);

View File

@ -1,6 +1,6 @@
// join/leave // join/leave
(async function(){ (async function(){
var webhook = new Discord.WebhookClient({url: config.webhooks.welcome}); var webhook = new Discord.WebhookClient({url: config.webhooks.welcome, allowedMentions: {parse: []}});
dClient.on('guildMemberAdd', async member => { dClient.on('guildMemberAdd', async member => {
if (member.guild.id != config.guildID) return; if (member.guild.id != config.guildID) return;
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;