我如何找到所有频道 ID?

How can i find all channel ids?

def SpamRequest():
    channel_id = random.choice(channel_ids)
    r = requests.post(f"https://discord.com/api/v9/channels/{channel_id}/messages", data=payload, headers=header)

如何找到所有带有请求的频道 ID?

来自 api docs

{
  "id": "41771983423143937",
  "guild_id": "41771983423143937",
  "name": "general",
  "type": 0,
  "position": 6,
  "permission_overwrites": [],
  "rate_limit_per_user": 2,
  "nsfw": true,
  "topic": "24/7 chat about how to gank Mike #2",
  "last_message_id": "155117677105512449",
  "parent_id": "399942396007890945",
  "default_auto_archive_duration": 60
}

示例频道。只需加载 json.

channel_ids = requests.get(f"https://discord.com/api/v9/guilds/{guild_id%}/channels", headers=header)
for channel in json.loads(channel_ids.text):
    print(channel['id'])