From 875c6762f58d3ba5dfa52fe32fdf7dd8453b71af Mon Sep 17 00:00:00 2001 From: Ali Hesari Date: Sun, 20 Sep 2026 16:16:20 +0200 Subject: [PATCH] feat(accounts): add can_post to the Discord channel model --- src/fopost/models.py | 2 ++ tests/test_accounts.py | 1 + 2 files changed, 3 insertions(+) diff --git a/src/fopost/models.py b/src/fopost/models.py index f2b9ab3..be93a11 100644 --- a/src/fopost/models.py +++ b/src/fopost/models.py @@ -452,6 +452,8 @@ class DiscordChannel(FopostModel): type: int = 0 parent_id: str | None = None nsfw: bool = False + """``can_post`` is False when a channel permission in Discord shuts the bot out.""" + can_post: bool = True is_current: bool = False diff --git a/tests/test_accounts.py b/tests/test_accounts.py index 87ea39a..83ec2bd 100644 --- a/tests/test_accounts.py +++ b/tests/test_accounts.py @@ -277,6 +277,7 @@ def test_discord_channels_and_identity(client: Fopost) -> None: "type": 0, "parent_id": None, "nsfw": False, + "can_post": True, "is_current": True, } ]