diff --git a/commands/random/portal-send.js b/commands/random/portal-send.js index 968878b8..85819e51 100644 --- a/commands/random/portal-send.js +++ b/commands/random/portal-send.js @@ -14,8 +14,9 @@ module.exports = class PortalSendCommand extends Command { prompt: 'What message do you want to send?', type: 'string', validate: (message) => { - if (message.length < 1500) return true; - else return 'Message must be under 1500 characters.'; + if (message.length > 1500) return 'Message must be under 1500 characters.'; + else if (!/(discord(\.gg\/|app\.com\/invite\/|\.me\/))/gi.test(message)) return true; + else return 'Please do not send invites.'; } } ] @@ -25,7 +26,8 @@ module.exports = class PortalSendCommand extends Command { async run(msg, args) { const { message } = args; const channel = this.client.channels.filter((c) => { - if (!c.topic || !c.permissionsFor(this.client.user).has('SEND_MESSAGES')) return false; + if (c.type !== 'text') return false; + else if (!c.topic || !c.permissionsFor(this.client.user).has('SEND_MESSAGES')) return false; else if (msg.guild.id === c.guild.id) return false; else if (c.topic.includes('')) return true; else return false; diff --git a/package.json b/package.json index 5c2d981d..5e2b635f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "25.3.0", + "version": "25.3.1", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {