Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/cpn_core/notifications/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
from typing import override

from discord import (
CategoryChannel,
Client,
DMChannel,
Forbidden,
GroupChannel,
ForumChannel,
HTTPException,
Intents,
TextChannel,
User,
)
from discord.abc import PrivateChannel

from cpn_core.models.notifications.discord import DiscordConfig

Expand All @@ -37,12 +37,13 @@ async def _send_channel(self) -> None:
logger.error("Discord channel ID %d: Not found", self.discord.chat_id)
return
if (
not isinstance(channel, TextChannel)
or not isinstance(channel, GroupChannel)
or not isinstance(channel, DMChannel)
isinstance(channel, ForumChannel)
or isinstance(channel, CategoryChannel)
or isinstance(channel, PrivateChannel)
):
logger.error(
"Discord channel ID %d: Must be text channel", self.discord.chat_id
"Discord channel ID %d is not sendable channel",
self.discord.chat_id,
)
return
for message in self._messages:
Expand Down