From 71bbbbcf5dd339fe5c65699036852efceb63716c Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 12 Mar 2023 20:26:44 +0100 Subject: add is_forum_channel predicate --- botstrap.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'botstrap.py') diff --git a/botstrap.py b/botstrap.py index d5dbacac3..caf4459d7 100644 --- a/botstrap.py +++ b/botstrap.py @@ -82,6 +82,13 @@ def create_forum_channel(channel_name_: str, guild_id: str, client: DiscordClien return response.json()["id"] +def is_forum_channel(channel_id_: str, client: DiscordClient) -> bool: + """A boolean that indicates if a channel is of type GUILD_FORUM""" + + response = client.get(f"/channels/{channel_id_}") + return response.json()["type"] == GUILD_FORUM_TYPE + + def delete_channel(channel_id_: id, client: DiscordClient): """Upgrades a channel to a channel of type GUILD FORUM""" -- cgit v1.2.3