This commit is contained in:
dirty-bun-ops 2026-04-24 19:24:21 -05:00 committed by GitHub
commit 4b590976fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -422,14 +422,14 @@ def _create_thread(
path = f"/channels/{channel_id}/messages/{message_id}/threads" path = f"/channels/{channel_id}/messages/{message_id}/threads"
body: Dict[str, Any] = { body: Dict[str, Any] = {
"name": name, "name": name,
"auto_archive_duration": auto_archive_duration, "auto_archive_duration": int(auto_archive_duration),
} }
else: else:
# Create a standalone thread # Create a standalone thread
path = f"/channels/{channel_id}/threads" path = f"/channels/{channel_id}/threads"
body = { body = {
"name": name, "name": name,
"auto_archive_duration": auto_archive_duration, "auto_archive_duration": int(auto_archive_duration),
"type": 11, # PUBLIC_THREAD "type": 11, # PUBLIC_THREAD
} }
thread = _discord_request("POST", path, token, body=body) thread = _discord_request("POST", path, token, body=body)
@ -669,9 +669,9 @@ def _build_schema(
"description": "Snowflake ID for forward pagination (fetch_messages).", "description": "Snowflake ID for forward pagination (fetch_messages).",
}, },
"auto_archive_duration": { "auto_archive_duration": {
"type": "integer", "type": "string",
"enum": [60, 1440, 4320, 10080], "description": "Duration before the channel is automatically archived (minutes).",
"description": "Thread archive duration in minutes (create_thread, default 1440).", "enum": ["60", "1440", "4320", "10080"],
}, },
} }