diff --git a/package.json b/package.json index ff1213f9..579b2ba1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "114.7.0", + "version": "114.7.1", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": { diff --git a/structures/phone/PhoneCall.js b/structures/phone/PhoneCall.js index 32d4c76e..95f16b24 100644 --- a/structures/phone/PhoneCall.js +++ b/structures/phone/PhoneCall.js @@ -1,4 +1,5 @@ const { shorten, verify } = require('../../util/Util'); +const inviteRegex = /discord(\.gg|app\.com\/invite|\.me)\//gi; module.exports = class PhoneCall { constructor(client, origin, recipient) { @@ -54,7 +55,9 @@ module.exports = class PhoneCall { send(channel, msg) { if (msg.content.toLowerCase() === 'hang up') return this.hangup(channel); this.setTimeout(); - return channel.send(`☎️ **${msg.author.tag}:** ${shorten(msg.content, 1500)}`); + let content = msg.content.replace(inviteRegex, '[redacted invite]'); + content = content.length > 1000 ? `${shorten(content, 1000)} (Message too long)` : content; + return channel.send(`☎️ **${msg.author.tag}:** ${content}`); } setTimeout() {