I have a discord bot that I've been working on. It will sometimes encounter errors, and I will be busy doing something somewhere else, and I don't wish for potential clients to have long downtimes. I've found a way that I can have it send me a dm regarding the error. The thing is, I use discord for other purposes and will get many dms throughout the day. I still want to be able to receive these messages without having to turn them ALL off when I'm busy, but I was wondering if there was a way to load the location that the dm came from so that, when I'm busy, I can get notices about dms from the bot, but not other people.
I've found that I can use the requests library in python to constantly search for information in the direct messages with discord's "https://discord.com/api/v9/channels/{ID}/messages" api, but I have found that this can take a lot of internet, and I don't really want to reload the messages every single time, and I've also noticed that this can be against Discord Community Guidelines if used incorrectly, so I want to avoid using it.
headers = {
'authorization': '{authkey}'
}
r = requests.get(f'https://discord.com/api/v9/channels/{ID}/messages?limit=1', headers=headers)
data = r.json()
#more code that parses and reads the data...
Is there a way to extract the "ping" function from discord's website to load the pings that I have and look for one that is from the bot instead of loading the messages? I've looked for the xhr api key, but after many refreshes, I can't find ANYTHING that is related to pings, but the data is obviously getting pulled from somewhere.