async def list_tags
Browse files
app.py
CHANGED
@@ -158,7 +158,17 @@ def post_to_slack_create_thread(channel, text, thread_ts=None):
|
|
158 |
return response['ts'] # Return the Slack message timestamp (thread ID)
|
159 |
except SlackApiError as e:
|
160 |
print(f"Error posting to Slack: {e.response['error']}")
|
161 |
-
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
#----------------------------------------------------------------------------------------------
|
164 |
|
|
|
158 |
return response['ts'] # Return the Slack message timestamp (thread ID)
|
159 |
except SlackApiError as e:
|
160 |
print(f"Error posting to Slack: {e.response['error']}")
|
161 |
+
return None
|
162 |
+
|
163 |
+
|
164 |
+
@bot.command()
|
165 |
+
async def list_tags(ctx, forum_channel_id: int):
|
166 |
+
if ctx.author.id == 811235357663297546:
|
167 |
+
forum_channel = bot.get_channel(forum_channel_id)
|
168 |
+
if isinstance(forum_channel, discord.ForumChannel):
|
169 |
+
tags = forum_channel.available_tags
|
170 |
+
tag_list = [tag.name for tag in tags]
|
171 |
+
await ctx.send(f'Available tags: {", ".join(tag_list)}')
|
172 |
|
173 |
#----------------------------------------------------------------------------------------------
|
174 |
|