Skip to content

Commit 7d44bc1

Browse files
committed
fix zookeep permission checking
1 parent 5151d29 commit 7d44bc1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/modules/moderation/zookeep.command.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,18 @@ export const ZookeepCommand: Command<ApplicationCommandType.User> = {
102102
}
103103
const applicableChannel = interaction.channel;
104104

105+
// if the command is being done in a private or special channel...
105106
if (
106107
applicableChannel &&
107-
!applicableChannel.permissionsFor(guild.roles.everyone).has("ViewChannel")
108+
!applicableChannel
109+
.permissionsFor(guild.roles.everyone)
110+
.has("SendMessages")
108111
) {
109112
// send it in general instead
110113
const generalChannel = guild.channels.cache.get(config.channels.general);
111114
if (
112115
generalChannel?.isTextBased() &&
113-
generalChannel
114-
.permissionsFor(interaction.client.user)
115-
?.has("SendMessages")
116+
generalChannel.permissionsFor(interaction.user.id)?.has("SendMessages")
116117
) {
117118
await interaction.reply({
118119
content: `Zookept successfully executed! Posting the result in <#${config.channels.general}>.`,

0 commit comments

Comments
 (0)