From e0a86a919e02600b0832fde0283d78fb6f8e9378 Mon Sep 17 00:00:00 2001 From: ame Date: Wed, 27 Sep 2023 16:39:38 -0500 Subject: fix restrict(ed) channels --- commands/util/defaults/emote.js.json | 4 ++-- events/interaction.js | 4 ++-- events/message.js | 4 ++-- index.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/commands/util/defaults/emote.js.json b/commands/util/defaults/emote.js.json index 9dd461b..0f29377 100644 --- a/commands/util/defaults/emote.js.json +++ b/commands/util/defaults/emote.js.json @@ -41,5 +41,5 @@ "triggered":"triggered", "wag":"wagged", "wink":"winked" -}},"cooldown":3600,"desc":"Sends a gif","restrict":[],"restricted":[], -"usage":"{command} [user]"} \ No newline at end of file +}},"cooldown":3600,"desc":"Sends a gif","restrict":["825023574221783102","1058360872587767819"],"restricted":[], +"usage":"{command} [user]"} diff --git a/events/interaction.js b/events/interaction.js index 3a3b32a..c65ecb7 100644 --- a/events/interaction.js +++ b/events/interaction.js @@ -22,8 +22,8 @@ module.exports = { interaction.user = interaction.guild.members.cache.get(interaction.user.id) let mod = interaction.user.permissions!=null&&interaction.user.permissions?.has(PermissionsBitField.Flags.KickMembers) let command = global.s_commands.find(o => o.name === interaction.commandName) - if(!((!command.command.config.restrict||command.command.config.restrict.includes(interaction.channel.id))&& - (!command.command.config.restricted||!command.command.config.restricted.includes(interaction.channel.id)))&&!mod) + if(!((!command.command.config.restrict||command.command.config.restrict.length==0||command.command.config.restrict.includes(interaction.channel.id))&& + (!command.command.config.restricted||command.command.config.restricted.length==0||!command.command.config.restricted.includes(interaction.channel.id)))&&!mod) return interaction.reply({content:"you cannot send this here! try `sns help` for more info",ephemeral:true}) if(command==null) return; diff --git a/events/message.js b/events/message.js index 817a592..59e79ef 100644 --- a/events/message.js +++ b/events/message.js @@ -76,8 +76,8 @@ module.exports = { com_string.shift() com_string = parse_inp(com_string.join(" ")) try{ - if(((!com.config.restrict||com.config.restrict.includes(message.channel))&& - (!com.config.restricted||!com.config.restricted.includes(message.channel)))||mod) + if(((!com.config.restrict||com.config.restrict.length==0||com.config.restrict.includes(message.channel))&& + (!com.config.restricted||com.config.restricted.length==0||!com.config.restricted.includes(message.channel)))||mod) if(mod||com.config.cooldown==null||com.last_command[uid]==null||(date.getTime()-com.last_command[uid].getTime())/1000>com.config.cooldown){ await com.main(client,Discord,message,com_string,com_call) com.last_command[uid] = new Date() diff --git a/index.js b/index.js index be5ab38..8d73ae5 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ process.stdout.write = process.stderr.write = (function(write) { access.write(string) } })(process.stdout.write) -process.title = "sns-chan" +process.title = "sns\-chan" /** * Module Imports */ -- cgit v1.2.3