Portal Send Improvements

This commit is contained in:
Daniel Odendahl Jr
2017-06-25 14:17:41 +00:00
parent df1a2f5dab
commit 36ab4d8b25
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -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('<portal>')) return true;
else return false;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "25.3.0",
"version": "25.3.1",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {