Skip to content

Commit 78a1a7c

Browse files
committed
change isinstance() check to channel.type check comapring to discord.ChannelType.private
1 parent d68c2de commit 78a1a7c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bot/exts/core/help.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from contextlib import suppress
55
from typing import NamedTuple
66

7-
from discord import Colour, DMChannel, Embed, HTTPException, Message, NotFound, Object, RawReactionActionEvent
7+
from discord import ChannelType, Colour, Embed, HTTPException, Message, NotFound, Object, RawReactionActionEvent
88
from discord.ext import commands
99
from discord.ext.commands import CheckFailure, Cog as DiscordCog, Command, Context
1010
from pydis_core.utils.logging import get_logger
@@ -206,7 +206,7 @@ async def on_raw_reaction_add(self, payload: RawReactionActionEvent) -> None:
206206
try:
207207
# We need to get the actual message and user objects for remove_reaction
208208
channel = self._bot.get_channel(payload.channel_id)
209-
if channel and not isinstance(channel, DMChannel):
209+
if channel and channel.type != ChannelType.private:
210210
# channel is None in DMs, this condition skips reaction removal in DMs to prevent exceptions
211211
message = channel.get_partial_message(payload.message_id)
212212
await message.remove_reaction(payload.emoji, Object(id=payload.user_id))

0 commit comments

Comments
 (0)