'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)

How can i find all channel ids whith reqests?



Solution 1:[1]

from 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
}

example channel. just load in 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'])

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1