mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Remove invites in phone messages
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "114.7.0",
|
||||
"version": "114.7.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user