diff options
author | 2023-03-12 20:26:44 +0100 | |
---|---|---|
committer | 2023-03-12 20:26:44 +0100 | |
commit | 71bbbbcf5dd339fe5c65699036852efceb63716c (patch) | |
tree | 5665bd43f2e4820a0b3d31b83bccc896cddd5276 /botstrap.py | |
parent | add new utilities to check/upgrade guild/channel states (diff) |
add is_forum_channel predicate
Diffstat (limited to 'botstrap.py')
-rw-r--r-- | botstrap.py | 7 |
1 files changed, 7 insertions, 0 deletions
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""" |