From 608a67c9ae4eea61bc532398ed615a4984db2ffc Mon Sep 17 00:00:00 2001 From: V Date: Tue, 26 Sep 2023 03:54:59 +0200 Subject: fix quick/searchReply & MessageClickactions not working in dms --- src/plugins/quickReply/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/quickReply') diff --git a/src/plugins/quickReply/index.ts b/src/plugins/quickReply/index.ts index 7a39ec0..118a51b 100644 --- a/src/plugins/quickReply/index.ts +++ b/src/plugins/quickReply/index.ts @@ -172,7 +172,8 @@ function shouldMention(message) { // handle next/prev reply function nextReply(isUp: boolean) { - if (!PermissionStore.can(PermissionsBits.SEND_MESSAGES, ChannelStore.getChannel(SelectedChannelStore.getChannelId()))) return; + const currChannel = ChannelStore.getChannel(SelectedChannelStore.getChannelId()); + if (currChannel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, currChannel)) return; const message = getNextMessage(isUp, true); if (!message) @@ -196,7 +197,8 @@ function nextReply(isUp: boolean) { // handle next/prev edit function nextEdit(isUp: boolean) { - if (!PermissionStore.can(PermissionsBits.SEND_MESSAGES, ChannelStore.getChannel(SelectedChannelStore.getChannelId()))) return; + const currChannel = ChannelStore.getChannel(SelectedChannelStore.getChannelId()); + if (currChannel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, currChannel)) return; const message = getNextMessage(isUp, false); if (!message) -- cgit