Home > Software engineering >  How do I scrape all discord group chats/dm ids that I am in?
How do I scrape all discord group chats/dm ids that I am in?

Time:11-21

I'm in many a lot of discord group chats and I need to scrape their ids for a testing tool that I'm making.

How do I scrape this id of every group chat that I am in?

CodePudding user response:

you can use the discord api to scrape the id's and since you tagged python I suppose you want the code in python. To get access to the api you need the authorization token for your account which you can search up on how to get, anyways this would be a viable way of scraping dms

channelIds = requests.get("https://discord.com/api/v9/users/@me/channels", 
headers={"Authorization": "discord_token_here"}).json()
for channel in channelIds:
    print(channel['id']) #or do whatever you want with the id's
  • Related