0

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.

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Aug 16, 2024 at 20:50

1 Answer 1

0

I have found that it is impossible to call this without interacting with a browser element and using javascript functions to pull a ton of information from the website itself, so, I have decided that it is most practical to create a discord bot that can read pings. I can then have the bot send the information to me.

Sign up to request clarification or add additional context in comments.

1 Comment

As this does not answer OPs question but suggests an other way this answer should rather be a comment. Once you'll earn enough reputation you'll be able to post comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.