The issue with saying TypeScript only for Deno is that people might assume that the other JS libs don't support TS.
#github-notifications
1 messages · Page 20 of 1
I do agree with you guys that specifying runtime, may not be necessary but I feel it would be inaccurate to label this as a JS lib. Although people can confuse it at times because TS is built on top of JS, TS is its own language, that transpiles to JS which could one day transpile to WASM or anything else. To a TS developer, a project that's built with TS is very different to a project built in JS with typings.
Having typings is not the same as properly supporting TS as a library built wi...
Http headers are case insensitive. Doesn't really matter what case we decide to in the docs - the choice is to make them camel cased to show each word (this is technically what we emit in our code - but there is varying levels of proxying that down-cases headers. Either way, basically every http client implementation treats them as case insensitive. Which means it's really irrelevant which casing they have in the docs. For now, we will keep them as they are.
Por favor, este não é o canal para resolver problemas relacionados ao desenvolvimento de bots em si. Também não é o local para se falar português.
O melhor que eu posso fazer é te apontar para a guilda mas, deixo a nota de que você ainda não vai conseguir resolver seus problemas em português na guilda, aqui fica o convite: discord.gg/discord-api. Boa sorte.
Please, this is not the channel to solve problems related to the development of bots themselves. It is also not the pl...
I'm not entirely sure this is necessary. All endpoints which result in an audit log entry support the header.
Yeah but the clients do not show reasons on some actions, even though a reason is attached.. I'e deleting invites and channels.
This is a recurring question in DAPI because "All endpoints which result in an audit log entry" is somewhat awkward to discover, relative to having an explicit list that links to the relevant endpoint for the given audit log event.
You're left to infer which endpoints are responsible for each event - something like this would improve that learning step.
well the bot has it and doesn't have it, like the owner has it but the bot itself doesn't have a 2fa auth seed linked so that's probably throwing it off?
GitHub is being dumb and not loading the comment dialog; should content be a type ?string, since you can null it to remove the content iirc?
It's not shown in the diff, but above the table it says
All parameters to this endpoint are optional and nullable.
I'm not entirely sure this is necessary. All endpoints which result in an audit log entry support the header
@jhgg
It is generally useful to have the information about the headers and body needed in the place that describes that endpoint... otherwise you have to jump between several places just to find out the functionality of an endpoint. As a developer, that is confusing and consumes more time, especially if you are only just starting with using this API rather than already knowing ...
Wait, so the limit isn't just one every five seconds? Is this new behaviour?
Is this new behaviour?
No, this has been a feature for years. They just now added a field which allows us to find out which concurrency limit a bot is eligible for. Only large bot owners are eligible, so this feature was rather niche and unknown until now.
@MinnDevelopment cheers for clarifying
Idea: A more future-proof solution instead of adding a message box to every endpoint would be adding icon tags next to endpoints that describe specific features. So the endpoints that support X-Audit-Log-Reason would get a little icon next to them which on hover shows that this header is supported and on click takes the user to a more detailed description about the header. It would also allow an endpoint to be tagged with multiple icons at the same time, in case new features arrive in the fut...
How can i get member count of my server in bot and send it to my website?
https://discord.com/developers/docs/resources/guild#get-guild
In the future, use https://discord.gg/discord-api (in #api) to ask these kind of questions. 👍
i can't access discord website, can u write it for me?
Request this with the appropriate authorization header and you should be good to go..
GET https://discordapp.com/api/guilds/:id?with_counts=true
```httpspec GET https://discordapp.com/api/guilds/:id?with_counts=true
where? how?
There's been similar feature requests for labeling which endpoints are used by oauth2/bots. While it would be cool, I don't see Discord spending time building that feature out anytime soon.
Adding links to the endpoints in the Audit Log Events table is a much smaller diff, is easily understood, and will work today. It may not be the most discoverable place, but it is the Audit Log page, a...
They could always consider delegating some power to a small handful of trusted people that contribute to this documentation, while still requiring PR reviews.
Would enable the community to shape the documentation into a format that we find useful and helpful, rather than one that Discord thinks we will find useful and helpful, as having direct access to the source code does introduce a tincy amount of bias towards how understandable some slabs of text and some tables would be.
Would also po...
Rather than an infobox after the description, might I suggest simply adding "Creates an audit log entry" to the descriptions? Many endpoints that fire off a gateway event will describe that within their description, i.e. "Fires a Channel Update gateway event". Perhaps we could do the same for audit logs, i.e. "Fires a Channel Update gateway event, and creates an audit log entry" (or simply "Creates an audit log entry" where the endpoint does not fire off a gateway event).
Just because something makes an audit log entry, doesn't mean you can specify this header unfortunately.
EMOJI DELETE didnt pay attention to the audit log header when I tried it a few days ago, despite being audit loggable.
While that is likely a bug, it would rely on the devs actively addressing every case that this occurs in (not sure if others exist), for this to be useful.
Then I would suggest marking those bugged endpoints as being bugged. There's no point in making a distinction since the endpoints that don't support the header yet make an entry are exceptions, not the rule, according to what was said above:
All endpoints which result in an audit log entry support the header.
I doubt the devs will let us merge a change that says "this endpoint is broken"... so until we get some form of response or resolution on that specific case, it would prevent being able to make any progress with improving the clarity of this aspect, I fear.
We intentionally made it harder to obtain full member list data, as at scale it is has become impractical to sync massive lists of members and there are privacy concerns with sharing full lists of guild members. You can still obtain members via chunking via REQUEST_GUILD_MEMBERS if you have guild members intent.
Thanks for the feedback. We do have plans to feed the concept of non-verified vs verified bots into our anti-abuse platform as it spins up, which is our optimal approach for dealing with these scam/spam bots. In an ideal world we're looking to stop these without introducing additional complexity into our products just for these kinds of bots.
should be fixed in the next api deploy
In general, if it's in our documentation it is meant to be supported/usable by bots. If you see something in our docs which isn't, I would recommend opening up an issue for that specifically as perhaps it was accidentally documented.
Thanks for looking into this.
In the current state of the API you have to chunk every single guild if you don't have the GUILD_PRESENCES intent set because it doesn't send the entire member list, regardless of the size of the guild. Even if the guild only has 10 members you have to chunk them which becomes a painful process when you are limited to a 120/60 rate limit. As far as I know the vast majority of guilds have less than 100 members, yet the same limits apply.
Privacy concerns make sense but some bots do require ...
please familiarise yourself with how HTTP functions and how to work with an HTTP API before attempting to do this; Discord's API isn't the best place to start if you haven't used a RESTful web API before. If you are using a library to interact with the Discord API rather than making RESTful web requests directly, please consult the documentation for that library and/or chat with the maintainers of said library for advice on how to tackle this :)
Some documented properties are only accessible via OAuth2/Get Current User instead of the Get User endpoint, which is what I believe Andre is asking about.
I can agree to what MinnDevelopment said.
My bot is in almost 14k Discord server now and chunking Members without access to the GUILD_PRESENCES intent is a near-impossible thing to do as the bot more than once hits the rate limit, causing delays and artificially increase the loading time of what was more or less 40+ seconds to well over 1 minute if not even 2 or more.
I can understand your concerns with privacy, but the near fact that almost 90% of all bots (Rough estimate but I'm quite...
Yeah, mostly.
Some specific features within the documentation require elevated OAuth2 scopes that usually aren't asked for when inviting a bot (And often also require separate handling by the bot itself)
And I'm also pretty sure that most of the things listed under "Game and Server Management", "Rich Presence", "Game SDK" and "Dispatch" aren't meant for bots so the excuse of "If it's documented, then it's available for bots" doesn't really work here.
I'm pretty sure Discord does not want you to fetch all users for those use cases.
- for user info, you should just fetch that specific member if they arent cached from a previous event
- for welcoming users, fetching users on start wouldn't help at all, and the member info is sent in the event
- for anything triggered by a message, the member object is sent in the event
By being used by bots, I think they meant just "programmatic access for developers"
This excludes user client only endpoints but includes these things and tools.
Although I'm not 100% sure about the whole "Game and Server Management" thing on this.. the documentation is also for game developers and it wouldn't really be bad if that stuff was in the docs imo
for user info, you should just fetch that specific member if they arent cached from a previous event
I would like to quote myself:
[...] some bots do require the members to be present in cache, for example to track changes of nicknames or roles. The API is built in a way that only tells you that an entity is updated, but doesn't tell you what has been updated.
On another note:
for anything triggered by a message, the member object is sent in the event
I don't understand ...
I personally just find it odd that the members aren't sent in GUILD_CREATE with the GUILD_MEMBERS intent. It's unintuitive to say the least, but I understand that I don't know the infrastructural / business logic reasons for it. If the bot is verified for the GUILD_MEMBERS intent, it would be implied that it's use-case is approved for knowing of (all) members in a guild and hence a candidate for the field in the GUILD_CREATE event.
There are also cases such as the one I made a feature request for earlier, #1612, which would really help reduce the requirement for keeping entire caches loaded for some bots.
Sleepy Discord is a library with the main feature being that it's modular and low level when needed but not when using the defaults. The library is almost 4 years old and has users using it for it’s modularity and also because they just want to use c++. As such, the library is made to fit both wants or needs. Right now the fixes are all in the develop branch but I plan to pull when no one here finds any issues with the rate limiter or any other bugs.
Last time, I made a request. There were...
Webhook usernames are identical to User usernames, so they cannot contain custom emoji in them. You can use normal emoji though..
More likely we will just set a static timestamp :)
@andersfylling do you have a specific host we can repro with? it's possibly a side-effect of some recent upgrades we've deployed
We split off characters after the last / to query metadata from the wiki api, so that's likely the culprit .. I'm actually a bit surprised wikipedia doesn't urlencode that forward slash.
We have no current plans to expose presence data without the intent due to privacy concerns. You can access a single member's presence via REQUEST_GUILD_MEMBERS using presences: true and passing the user's id when using the presences intent.
The issue is that if you have a use case such as userinfo where you only need to get one user's presence, you get denied the intent because that doesn't justify getting all presence updates. Maybe allow bots to get whitelisted to only get a single user's presence? however that would be more work for Discord
Bot created group DMs are intentionally temporary and will be automatically deleted after a time period. They were created for the use case of supporting temporary voice chat for games back in Gamebridge times. I would consider usage of this deprecated, and it may ultimately be removed in the future. We are not adding additional functionality to this as a result.
Wait, why is this closed? What about part two?
It looks to be filling those values normally. perhaps there was a bug which has now been fixed?
to jake's point, if the action results in an audit log entry being created then the header should work (the code as written pulls the header during record creation, if it's available). please open an issue if that's not the case with a reproducible test case.
This is probably a regression, since this used to work.
This isn't really a bug, per-se. Successful response here means the member, if one existed, has been kicked. We do similar behavior on many endpoints, though it is not consistent across them all since it doesn't really matter. You will see similar behavior on PUT requests too, where PUTing the same resource may result in a 204.
We most likely will not tear this into different permissions, since embeds and links are one in the same functionality wise. It is possible we may explore better permission acquisition for bots in the future, which may improve the flow of bots obtaining permissions they require for functionality.
It looks like we are not handling bots properly in a couple application level mfa checks. Bot/application owned guilds are a hack we created for Gamebridge back in the day. We may remove this functionality in the future so I wouldn't rely on it for new integrations. In the meantime you can probably transfer the owner of the server to yourself to set mfa on it.
We will be doing a pass to update the documentation in the future once this becomes inaccurate.
If the user is consistently sending invalid codes back, then it is likely you are receiving invalid or duplicate codes.
I've looked into the many times at this point, but it's not likely a bug on our end apart from potential redis drops during an outage.
this should be fixed
This seems to work just fine for me:
curl https://discord.com/api/v6/guilds/redacted/emojis/redacted -X DELETE -H 'X-Audit-Log-Reason: test' -H 'Authorization: Bot redacted'
@night I'm able to reproduce this relatively easily with a small number of users. It seems to be a per user issue, so I was thinking it had something to do with how their data is stored or a flag on their account. I'm happy to provide user ids, timestamps, etc, but I don't know where to send them.
Delete webhook with token doesn't seem to accept the audit log reason header despite being an endpoint that will "result in an audit log entry". This is shown with the following request.
> DELETE /api/webhooks/715052263395164192/QlJXN6hBvYOxgY-JIylpxieYx7UnRcT8q-NExnQ0tPsKnEDmRgg2ZRHCTFUDoG_7NeSy HTTP/1.1
> Host: canary.discordapp.com
> User-Agent: insomnia/7.1.1
> X-Audit-Log-Reason: Hi Hi
> Accept: */*
< HTTP/1.1 204 No Content
< Date: Wed, 27 May 2020 04:03:45 GMT
< Co...
Thank you very much! :)
Not quite sure if it got fixed, but I recently found API Communication issues from Discord & Spotify, giving my discord a lot of errors in console.
Are you talking about the 401's in console? That's just Spotify oauth tokens expiring, they're only valid for an hour ish and the client refreshes the token whenever it receives that error.
You don't need to worry about it, also in the future if you find an actual bug, it should be reported in Discord Testers (https://discord.gg/discord-testers). This repository is reserved for Discord API issues.
An endpoint similar to Get Current Application Information but for fetching info about any application with its id (without fields that need to be private of course). This would be useful for a few reasons:
- programmatically getting a bot's (estimated) server count, which can already be done manually via the OAuth page (expands on #1628)
- seeing the true owner(s) of a bot, to prevent another user clai...
@night It seems slightly disappointing that the clarity and ease of understanding for documentation that is being aimed at the community is being decided by developers that most likely know the internal code base. Regardless of internal opinions, several people expressed the same kinds of opinion for this. Closing this without further discussion seems a little bit of a shame, given it is a discussion towards making this API more accessible to people...
I honestly would urge stuff like thi...
On https://github.com/yourWaifu/sleepy-discord/blob/61d9c6f7f4021a417df7c33ac4640b1d0d345059/sleepy_discord/client.cpp#L161, you seem to only apply backoff logic in the case that you appear to be ratelimited, but do not get a ratelimited response.
Surely the only time that would happen is if you were making an unauthorized request in the first place? Otherwise you can assume that if the remaining bucket capacity was zero, you'd receive the 429... and you probably shouldn't be spamming unau...
The documentation for opcode 4 on the gateway (voice state update) is marked as being sendable only.
The voice documentation then says the complete opposite, by telling us we should wait for the gateway to send opcode 4 to us after we send it to them.
On the BaseDiscordClient::getTheGateway() procedure, you appear to use an undocumented endpoint, as well as using the old API URL that will be deprecated entirely later this year, since you hard code this, no one can use this current release of your library without having to be forced to incorporate at least one bugfix later this year if they want an application to be ...
@mdashlw the documentation suggests the use of /api/v6/gateway, not /api/gateway. That isn't documented anywhere on the link you provided or inferred as being documented from the REST versioning scheme.
discord.py appears to use this as well.
Discord.py does a lot of things that are undocumented, whether all libraries should follow is still questionable, especially since anything undocumented can potentially be changed and break the entire application without notice.
Updated to clarify my actual point, as I realise I worded that terribly. My bad :)
You are talking about 2 different gateways. The voice gateway has its own set of op codes which are not connected to the main gateway op codes in any way.
Voice state update on v6 from the gateway provides a payload like this:
{"token": "guess what", "guild_id": "265828729970753537", "endpoint": "eu-west93.discord.media:80"}
Since this is port 80, I assume we use ws and not wss. Hitting ws://eu-west93.discord.media:80 provides me with a 403 and a cloudflare error

Using wss:// causes my client to issue an "in...
Are you talking about the VOICE_SERVER_UPDATE? The port on the endpoint should always be ignored by the client.
@MinnDevelopment doing this causes the same issues.
Data I could scrape:
{'Date': 'Wed, 27 May 2020 16:13:26 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'X-Frame-Options': 'SAMEORIGIN', 'Cache-Control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'Expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'Set-Cookie': '__cfduid=d3792e8f9851713415d7c1d38e5260d6d1590596006; expires=Fri, 26-Ju...
Upgrade headers were
{'Upgrade': 'WebSocket', 'Connection': 'Upgrade', 'Sec-WebSocket-Version': '13', 'Sec-WebSocket-Key': 'U8nuLstAPfxu5S6r4hNjuA=='}
if that is of help. Someone has suggested that the Upgrade needs to be in lower case, which is something I cannot control without fundementally rewriting the websockets implementation I am using. If this is the case, this is probably a bug, since [RFC-6455 specifies the token is registered as "WebSocket" explicitly on page 56](htt...
The upgrade header must be lowercase websocket.
See: https://tools.ietf.org/html/rfc6455#section-4
- The request MUST contain an |Upgrade| header field whose value
MUST include the "websocket" keyword.
@MinnDevelopment and page 21 says this is case insensitive. Page 56 says it is registered as "WebSocket", which aiohttp complies with :^)
Added a warning to the documentation to specify how clients should sanitise websocket URLs for voice.
Addresses the port confusion from https://github.com/discord/discord-api-docs/issues/1689. This now just needs Discord to make their websocket server RFC-6455-compliant to close that issue.
@mdashlw the gateway uri is not hardcoded. It's an option tho for testing purposes. This is a great place to test for that standard http get request is at least being sent. The hardcoded gateway compile option is for debugging for test if it's this that's stopping a bot from progressing.
I'll take a look when I get back. Another question I have is that; I keep getting random hello packets on the voice connection after thr first heartbeat. Should I ignore it? The docs do not mention that more hello phese packets should come after the first hello.
@taarek I don't understand why you send this. Seems pretty pointless since discord.com is being used in most request so I'm already aware of the base URL change. I just forgot that one somehow during my Ctrl f and replace.
@yourWaifu if it's an option to hardcode the gateway URL (and I can understand why one might want to do that) why not leave the actual value to the user and just provide them with the option to hardcode a gateway URL?
@acw0 not a bad idea, I just haven't thought of it.
You still receive it as an event. Otherwise I wouldn't have found the issue nor the solution to the other issue we are talking on.
I just tested and I only receive an op0 (dispatch) with t "VOICE_STATE_UPDATE":
{
"op":0,
"s":9,
"t":"VOICE_STATE_UPDATE",
"d":{...}
}
I'm not sure what you're talking about. The OP code used by the voice gateway has nothing to do with VOICE_STATE_UPDATE. They are completely different gateways with completely different OP codes. You will not receive a VOICE_STATE_UPDATE in the voice gateway.
ah, yeah, I see what you mean now. Yep, my mistake!
@nekokatt I would love to verify the http request before it's sent but sadly some http libraries aren't verbose enough to let you take peak before it's sent. This is however a minority but it having a verification step might stop those libraries unless it's skippable and if it is it then many would skip it for performance. The library does a test for the http request with discord at the very start using the get gateway request. I am aware that that doesn't cover the headers or body but Discor...
surely its just a case of validating your inputs. If you cant validate stuff like message length before sending, thats an architectural issue
@nekokatt I'm unsure how night is actually ignoring anything. The reason you wanted to document which endpoints support X-Audit-Log-Reason is because not all of them did in reality (at least, that's what I gathered) -- but twice thus far it's been said that all endpoints that create audit log entries should support it, and that any endpoints that act to the contrary should be reported.
If you'd like to document which endpoints create audit log entries, and maybe along the way figure out ...
@nekokatt I'm unsure how night is actually ignoring anything. The reason you wanted to document which endpoints support
X-Audit-Log-Reasonis because not all of them did in reality (at least, that's what I gathered) -- but twice thus far it's been said that all endpoints that create audit log entries should support it, and that any endpoints that act to the contrary should be reported.If you'd like to document which endpoints create audit log entries, and maybe along the way figur...
Sure we can check and make sure that data going into a HTTP library is garbage or not. But that doesn't mean that the output will be valid that the HTTP library is valid.
So the issue is that your HTTP library doesn't send well formed HTTP requests?
The library is modular, we don't know which HTTP library is being used. We have libcpr which uses libcurl as the default. But users are using other HTTP libraries that are more suited for their needs.
@andersfylling have you changed anything on your end (like the version you send) prior to seeing this?
I dug into it a big yesterday and so far haven't seen anything that would explain a change here. I suspect we've always been sending a float for heartbeat_interval for v >= 4 and that either we need to update the docs to say it is a number that might be a float or actually start sending an integer to respect what the docs say.
This sounds more like a bug than something we should document. Can you refrain from opening PRs with changes like this? In general, if we've not said something is working as intended, it's best an issue is created alone.
The intents are listed on the Discord docs as such:
GUILD_MEMBERS (1 << 1)
- GUILD_MEMBER_ADD
- GUILD_MEMBER_UPDATE
- GUILD_MEMBER_REMOVE
https://discord.com/developers/docs/topics/gateway#gateway-intents
To clarify what I mean by "sub-intents", I am referring to the dashed elements under the main intent group "GUILD_MEMBERS" in this example.
The intents are already very beneficial for improving performance, but if it were possible to subscribe to those in...
the voice servers are handling this fine, but we have a firewall on cloudflare which looked to be doing a case sensitive check. i modified this rule, which should have fixed this. can you confirm?
as for the port being locked to 80, that's most likely a bug. our clients rewrite this to port 443, but obviously we do not want you to connect on port 80 and this should return 443. I will see if we can get this updated to the correct port.
Fun fact: this port 80 has been returned by the API for at least 4 years.
Resolves #1510
Bots are able to use those 2 endpoints listed. More information in linked issue
(p.s. this is my first pr on the docs so if I did anything wrong pls let me know ta)
Thanks for the PR! I think we just want to confirm with @jonzlin95 that whatever behavior we may need to change internally before we make it too public is done (that he was referring to in that issue).
I assumed I was fine to make the PR by the label that was applied yesterday
Oh no yeah that PR is totally fine, I just mean before we hit merge and deploy it :)
You're missing a | here at the end of this line and the type of a snowflake id should be snowflake here as well
it would be more consistent to type snowflake ids as snowflake rather than string
Will get to these tomorrow morning
I'm trying to get a token to create a webhook for a user in a React app, using the following flow.
User clicks "create webhook button":
opened = window.open(
'https://discord.com/api/oauth2/authorize?client_id=715023697244717107&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fwebhook&response_type=code&scope=webhook.incoming',
'_self'
);
The user chooses a server and channel then is redirected to the endpoint in the Redirect URI
Then the respon...
The documentation is very explicit in the format required for the request, putting the following in a big yellow box that can be seen as soon as going to the OAuth2 page:
In accordance with RFC 6749, the token URL only accepts a content type of
x-www-form-urlencoded. JSON content is not permitted and will return an error.
Here, you're sending JSON content, which is exactly what the docs warn against. This repo isn't the best place for general debugging help; feel free to joi...
Currently only requests which are authenticated as a bot can specify this header, so it is ignored if you delete the webhook by its url.
Currently only requests which are authenticated as a bot can specify this header, so it is ignored if you delete the webhook by its url.
Does this not arguably muddle the definition of which endpoints accept the audit log entry reason header a bit in a way that might justify explicitly explicitly documenting which endpoints accept the reason header as these do fall under the rule of any endpoint "that results in an audit log entry" accepts this header while also being an exception to sai...
Closing.
The issue (aside from using the wrong content-type) was Javascript was capping the integer client ID. You must make sure the client ID is a string when using it in javascript.
Also just a question around some odd behavior that I've just discovered around using these endpoints while declaring a bot token as authorization as to whether this is intended behaviour or not.
When declaring a valid bot token in the authorization header these endpoints seem to not totally ignore the bot's authorization, leading to it accepting the reason header and showing the action as being done by the bot in the audit log entry regardless of whether the bot is in the guild the webhook...
the voice servers are handling this fine, but we have a firewall on cloudflare which looked to be doing a case sensitive check. i modified this rule, which should have fixed this. can you confirm?
as for the port being locked to 80, that's most likely a bug. our clients rewrite this to port 443, but obviously we do not want you to connect on port 80 and this should return 443. I will see if we can get this updated to the correct port.
The dev who opened the issue asked me to say t...
Issue related to #1690
The voice server update payload may contain a endpoint with an invalid url on the form: eu-central396.discord.media:80 which is wrong as it should be prepended with wss:// and will fail when connecting.
I can't run my discord bot online since this morning because any of the tokens I provide work. It had never happened before and I don't know what's the issue.
Currently, a bot is able to use emotes from servers it's part of, as they get Nitro perks for emote usage.
This is super helpful for some things like welcome messages, reaction menus and the like.
However, bots are limited to emotes from servers they are currently in, so these features will break if say a user with Nitro wants a welcome message with emotes from their servers that the bot isn't in for instance.
The current 'solution' for this is to create a dedicated emote server (or mo...
- This isn't support for d.js
- This isn't really related to the API
- Reset your token, and contact support if it continues to not work.
Title summarizes. When you go to server settings and copy the JSON API link it copies as discordapp.com instead of discord.com and it returns [ Widget Disabled | 50004 ]
It shows whatever domain you're using Discord on; if you use the web version it's discord.com.
If it says Widget Disabled, then you probably have the Enable Server Widget option off (or just turned it on, it might take a while)
Yeah, now that you mention it I do believe that I upgraded from v3 to v4. I must have followed the docs and assumed v4 to have the same data type. Causing me to wonder when the data type had changed.
Running endpoint on /guilds/:id/messages/search with invalid IDs for author_id or mentions params returns all messages instead of none. So far I've only been able to check this on canary, I haven't been able to check if this is the same via the api from my bot, though looking at the api response, it does look like it'll respond with the same thing
[discord/discord-api-docs] New comment on issue #1698: Searching messages with invalid from/mentions
Bots cannot use the search endpoint.
[discord/discord-api-docs] New comment on issue #1698: Searching messages with invalid from/mentions
Ok well it's still an api bug since it shouldn't be returning all the messages
[discord/discord-api-docs] New comment on issue #1698: Searching messages with invalid from/mentions
I don't think this can be reproduced from the client? looks like if it can't find the user, it just includes the provided tag in the content
[discord/discord-api-docs] New comment on issue #1698: Searching messages with invalid from/mentions
I'm able to reproduce this in the client with any user id that's not in the server. I was under the impression this issue was reported over at Discord Testers however
[discord/discord-api-docs] New comment on issue #1698: Searching messages with invalid from/mentions
I did this with guild/channel/emoji IDs and 123456789012345678 as well, so it just seems like any "possible" id
Prepending this in the API with the wss:// would break every existing JDA bot. We prepend it in code and it would result in wss://wss://eu-central396.discord.media/?v=4.
They probably mean that when the user/lib adds wss://, it will break when trying to connect to port 80.
my voice implementation just removes the :80, while that was never instructed or documented it has always worked for me
This would be pretty helpful for me, as I don't ever need to check message updates but they're the 2nd most common type of event I get from the gateway (about 40 per second on my bot)
maybe a system similar to how you can subscribe to events with RPC
or just use bitwise operators like existing intents.. dunno
It looks like Discord doesn't send messages when it receives a Github package webhook.
Ideally, it would look something like this (table represents embed fields):
Package published
{payload.repository.full_name}
Name Version {payload.package.name} {payload.package_version.version}
Published example:
Headers:
Request URL: https://discordapp.com/api/webhooks/***/github
Request method: POST
content-type: application/js...
Kinda it would be really good if it was only available to bots that are verified or have gateway intent privileges...
I've been working literally 3 and a half weeks on my userinfo command and got the normal badges done except for the nitro badges... Which i really want, so i would like to see this feature added to verified bots and bots with gateway intent access
I don't think this should be available outside of the way to get this information already - with the identify oauth scope
As the title says, in the gateway's documentation of the guild members chunk, the chunk_index's description has < instead of <. It can be seen here: https://discord.com/developers/docs/topics/gateway#guild-members-chunk
Not sure what's the desired solution since it looks fine on GitHub (see https://github.com/discord/discord-api-docs/blob/master/docs/topics/Gateway.md#guild-members-chunk). I can make a pull request if you have a solution in mind that I can do (idk if you want to cha...
This was already fixed, which is why GitHub looks fine, in #1682.
That makes sense and explains why I didn't find it while searching. Sorry!
I have an existing Discord OAuth application used purely for creating an account in a 3rd party website.
Everything used to work perfectly fine until today (I think).
All of the sudden, I'm getting "invalid_request" "Missing "code" in request." error every time I try to validate the code for OAuth.
I'm unsure why it's saying "missing" because I'm clearly sending the code in the post url.
This is the API path I'm using:
https://discordapp.com/api/oauth2/token?grant_type=authoriz...
Your OAuth2 implementation is incorrect. As the documentation states in https://discord.com/developers/docs/topics/oauth2#authorization-code-grant, you should be sending a POST request with a content-type of application/x-www-form-urlencoded. You are sending the parameters in the URI instead of in the body (where they should be).
The acceptance of these values in the querystring was a bug, and is now fixed from a library upgrade. Please refer to the RFC specification for more information: https://tools.ietf.org/html/rfc6749#section-4.1.3
Hello, my web app recently stopped working because of the bugfix that allowed values passed in from the URL to work when exchanging for an access token.
I was instructed to pass the parameters into the body, and I did as such

This returns a 400 bad request, with no indication of which field is invalid.
I'm not sure if it matters, but my loginURI is as such:
https://dis...
@night Could you please elaborate for me? Which library do I need to upgrade?
try changing new URLSearchParams(body) to just body.
BTW, to get help, first ask in the official Discord Developers or unofficial Discord API servers.
try changing
new URLSearchParams(body)to justbody.BTW, to get help, first ask in the official Discord Developers or unofficial Discord API servers.
I've also asked, and still have not found a working solution. I even copy/pasted the working solutions that some have had using Node, but it seems like I'm missing a step somewhere.
Discord updated a library they use to fix this bug; you need to send the values in the request body instead of as query strings in the URL as Sei4or said.
What does the body say? How old is the code you're testing with?
The code is just a few months old, but since I was passing in the values through the URL, I had to make it so that it passed it in the body instead.
The body has all the fields needed, but for some reason it just gives me a 400 without specification of why it's failing.
this will be fixed in the next api deploy
code being the code returned from authorization. codes expire shortly after their generation, so if you're testing with an old code, it will always error.
body being the response body our server gives you, not the request body. the response body will tell you what in your request is incorrect.
Solved it. It appears I was passing in the URL-encoded redirectURI instead of the plain URI.
I forgot I had two variables:
One encoded-redirect URL
and one plain URL.
I feel stupid now.
Thanks for all the help regardless!
If it's available to any user, i don't see why it can't be for bots. It's basically forcing people to use selfbots just for nitro check
This could also possibly be sent as a message through the official Discord account that notified us about bots being eligible for verification.
It shows whatever domain you're using Discord on; if you use the web version it's discord.com.
No sane person uses the web client and instead uses the desktop client, you cannot set which domain you're going to use on the desktop client,at least if it is not modded. It shows the discord.com domain on iframe and discordapp.com on json, if it were to actually use the domain that the person is using it wouldn't act like it has bipolarity.
Discord doesn't take bug reports from testers server,...
For me, both the "json api" and the "premade widget" fields use canary.discordapp.com. The desktop client using the discordapp.com domain isn't really an API issue.
As an aside, if this could be achieved with webhooks as well, that would also be great
Having the same problem here. It's really awkward behavior.
Couldn't you add some flag to the embed to make it at least easier to check against?
Checking for domain isn't that consistent, with the domain change etc.
Yes @aidangoettsch I will document the changes.
They will be minimal for these API docs as v5 was created for a feature for server video.
https://github.com/Rapptz/discord.py/issues/4154
guild api call fetch emoji doesnt return managed emojis ie, twitch subscriber emojis are not returned yet, guild.emoji contains the twitch subscriber emojis
WAYTOODANK
Fetching a specific emoji, or just fetching the guild object? There isn't a separate endpoint to only fetch all guild emojis, there's only the Get Guild endpoint which should include all in the emojis field.
There is an endpoint which the library in question uses: https://discord.com/developers/docs/resources/emoji#list-guild-emojis
@advaith1 fetching all guild emotes.
oh why is that in the emoji page instead of the guild page
why cant you just use Get Guild and check the emojis field? is that missing something you need? you said "yet, guild.emoji contains the twitch subscriber emojis" so that seems to be good?
yes guild.emojis seems to contain the twitch emojis, but when you query it from discord they are not on the force fetch.
Can you compare the direct responses of the List Guild Emojis endpoint and emojis in the Get Guild endpoint? the emoji-specific endpoint might just be there for backward compatibility or for settings in the client, if you can get all of them from the Get Guild endpoint then you can just use that
Currently, the IPC api is in use by the GameSDK, but is not mentioned at all in the API docs. The console messages from the client show that the GameSDK uses the IPC api. On the discord API docs, only the deprecated RPC api is documented. The GameSDK is awesome, but I think letting people interact with the IPC api would be better.
When using the Create Channel Invite endpoint. The documentation (and the endpoint) state that you can only pass 1 to target_user_type.
{
"code": 50035,
"errors": {
"target_user_type": {
"_errors": [
{
"code": "BASE_TYPE_CHOICES",
"message": "Value must be one of (1,)."
}
]
}
},
"message": "Invalid Form Body"
}
But when I try to use it setting it to 1, this happens:
Target: `https://discord.c...
Nothing is wrong with target_user_type. You get this error, because you do not pass a target_user_id field with it, instead you use target_user.
The docs probably mention that field badly.
the docs say the field is target_user and don't mention a target_user_id anywhere
https://discord.com/developers/docs/resources/channel#create-channel-invite
stop opening random github issues
If it's available to any user, i don't see why it can't be for bots. It's basically forcing people to use selfbots just for nitro check
Although I understand your point here, this simply isn’t true. Yes, it is available to users, and yes it should be available to bots the same way (in my opinion - read my other posts for more detail on my split thoughts), however this does not in any way promote self bots. Rather than using a self bot people Would simply... not use the info. I highly dou...
The REST endpoints to retrieve messages will only provide user information for guilds. This means it requires an additional request only to get the member information such as roles and the nickname. Stateless bots would greatly benefit from the member being included for both the author as well as the mentions. Potentially, this could be done using a query parameter such as include_members=true or similar.
I know bots won't be able to "Go Live" themselves, but would a way to get information about another user's stream be possible?
It would allow bots to get, for example, the amount of users watching the stream, who's watching etc. This could make it easier for bots to reward active streamers in the guild.
The main issue is that there is a bug in the app where in the discord emoji button gets a bit lagged. It follows a particular pattern happens on an occassion of 4-5 times later when the button is used . The thing is whenever I may have used the button it works simply but after using it 4-5 times the discord app gets hanged and then I need to close the app and reopen it after 5-6 minutes
Please submit this issue to https://discord.gg/discord-testers. This repository is reserved for Discord API bugs.
Looks like bots don't have access to create, edit, sync, or delete templates, or get the template from a server id.
Hello 👋
I was hoping to request the ability for bots to be able to enable/disable whether a user's activity or custom status shows in a server. I don't mean modifying or deleting the activity itself but a toggle to just set it so it does not display to users.
Use Case:
On an official game's servers, it's a bit silly to have users promote/advertise a competitor's game/server. Bots can already read and process user activities and custom statuses. They could be run through a filter and...
As it's most likely already known, there's an endpoint which allows you to view which members boosted the guild, and how many times.
guilds//premium/subscriptions
Sadly, this is a user-only endpoint, however I wonder if it'd be a good idea to open it up to bots;
I, personally, would like to retrieve this sort of data for my bot, but sadly cannot. I'm not entirely sure how many other individuals agree here, or are in the same situation. The only work-around for this would be to use a...
Not really an API related issue.. however that feature was suggested here: https://support.discord.com/hc/en-us/community/posts/360054590271
🤷♀️
I think this is a API request because I would want this controlled ideally through a bot which could filter those status/activities. You don't just want to disable everything. You just want to disable certain ones and imo thats best handled by each bot which can be customized per server on which statuses warrant disabling
We have no plans to allow for the individual moderation of custom statuses. Either kick the user, ask them to remove their status or don't hoist them to the top of the member list if you don't like their status.
@jhgg Could you please elaborate on why? I am really curious why this part is not moderated. I don't believe any of the three provided solutions are good.
Kicking the user for playing another game is not a good solution. Just because a user plays another game does not mean they are not a good/active/healthy user of this server. They should not be kicked because they played another game.
Asking a user to remove a status isn't really a valid solution either imo. What's the point of any mo...
My question is, why is it such a big deal that someone can't be shown playing another game? Why are we considering one game to be a competitor to another? I thought games were supposed to be fun, something to enjoy and share with others, not something that you're supposed to compare to one another like you would with sports teams.
And anyways, if you're concerned about games being "advertised" on the server, wouldn't you be better off moderating the text/voice chat, and weeding out adverti...
On servers I moderate, having an invite link in your username, nickname, status, or message (if the message is an advertisement) is all the same - either don't, or you get kicked/banned
I'm not sure why you would want to moderate on individual games, though. Maybe because of NSFW content in the RP?
| source_guild_id | snowflake | the ID of the guild this template is based on |
| code | string | the template code (unique ID) |
Represents a code that when used, creates a new guild based on the template data.
| serialized_source_guild | partial [guild](#DOCS_RESOURCES_GUILD/guild-object) object | the guild this template is based on |
IMO that wording seems to imply that the template is an individual thing with its own separate data, while it's actually just a server's data.
A server template can go out of sync with a server's data. Try creating a template in a server than adding or removing a channel. This means that they do include their own data.
Would it be possible for purge events to be added to the gateway? This would be a way for bots to know when a purge is in progress to temporarily pause some functionality such as audit log based kick detection or leave messages.
Purges on small servers usually do not have a big impact, but if a big server purges thousands and thousands of people over several hours. Being able to reliably know when a purge is happening to disable audit log checks or goodbye messages would be a good way to h...
is there any update on this? having a dedicated kick event would allow bots to rely on that instead of having to poll the audit logs every time someone leaves
@LikeLakers2 Why does any server have rules against having other discord servers invite links? That same logic applies to that as well. Server are supposed to be fun, enjoy and share with others.

When it comes to an official server for a game, it's business. Also, custom statuses/activities is word of mouth marketing.
@Mee42 I don't really want to moderate an individual ...
Just make your game the best one so that everyone plays it.
What a needless conversation to have. The cost it would take Discord to make this 'feature' is way more than it will ever be worth to anyone. If a server has enough members for you to have to scroll down to read them all, 99% of your users will never have their status read. It's silly to even ask for this. People play games, let them play in peace. If someone's on the server enough to even see that someone's playing a specific game a lot, they're already engaged with your content enough that ...
@SinisterRectus That's not really a solution to prevent ads.
@Flamanis Please re-read the messages as this isn't an issue about reading every users status.
Jake didn't say it wasn't possible, he said it wasn't planned. Furthermore, the stern first sentence should be enough of a clue that this is very likely not going to see any traction here. Could have just left it in limbo as well. I'd be glad there was any response at all so that you can plan more effectively for the future.
Also the way I see it, this is only specifically an API feature request after there's already a system in place to do the kind of status hiding that you want, whic...
If you have a big enough server, you could possibly dehoist users with banned games while they play the game.
But again, what's the harm of people playing Minecraft on your Animal Crossing server?
I am occasionally receiving HTTP response code 403 and body error code 50001 when trying to get a single "guild's" member. The following is the request I'm making (via Ruby HTTParty):
res = HTTParty.get(
"https://discordapp.com/api/guilds/#{server_id}/members/#{user_id}",
:headers => {
"Authorization": "Bot "
}
)
The request happens across multiple server IDs and user IDs, but whenever the error occurrs, it's possible for the same user to perform the same ac...
Requesting the /channels/:id/message endpoint with the query params around or before as an integer will not throw 400.
In this request I can set after to 1 to fetch the first message of the channel:
GET /api/channels/581635926757998613/messages?after=1&limit=1 HTTP/1.1
Authorization: Bot NTUxODI3ODI2MDQzNjUwMDQ4.******.***************************
Host: discord.com
snowflakes are bigints, so this is technically valid.
50001, INVALID_ACCESS, occurs when your bot does not have permission to perform this action. In this case it would seem your bot is not a member of the guild when you get this error. It could be someone joining/removing your bot from the guild
Not completely sure, but shouldn't you be using the api versions? /api/v6/guilds and not /api/guilds. Also, consider moving the api url to discord.com since that's rolling out in the future.
@mr-tech summarized it well. The effort to value ratio here is way off. This is easily a 2-4 week project and I don't think it's worth doing.
Server owners, including the official Discord Developers server, have rules that disallow certain user names and if a user name violates such rule, the moderation will force change their user name.
If that's possible, force changing / removing a custom status should also be possible for moderation purposes. I don't want to have people in my server who use their custom status to harass people, for example.
This issue has been resolved. We independently discovered that our bot was not present in the guild, so @night is correct. Might I request some further documentation for the error codes, such as explanations of how and when 50001 can occur?
I am building an application that uses discord for quick sign up and would like to add a feature to find and sync friends from discord, however, I couldn't find any information about the whitelisting in the documentation, what are the requirements and process for getting whitelisted?
[discord/discord-api-docs] New comment on issue #1718: How can one get whitelisted on oauth2 scopes?
Appreciate the desire to do so! Right now it's in private testing, and while we'd like to roll it out later, we aren't quite ready to do so yet.
Since Bulk delete actions are also logged in the audit log now would it only be logical to allow setting an audit log reason for the action.
That way could moderation bots much easier tell the reason of why messages where deleted and moderators could give a reason as to why they deleted the messages through the bot.
In addition, would it also be beneficial to log bots deleting messages of other members.
The Audit logs right now do only log it, when a normal user (moderator) deletes the m...
Submitting an array of snowflakes IE [ '496291897296551958', '496338713115361289', '717324717555712050' ]
returns a 400 with the error body
{ include_roles: [ '0' ] }
What do we need to include to get this working?
They are passed through an url parameter.
To prune for 30 days with the role IDs you provided it would be:
https://discord.com/api/v7/guilds/<guild_id>/prune?days=30&include_roles=496291897296551958&include_roles=496338713115361289&include_roles=717324717555712050
They are a querystring parameter for GET, but should be passed in the body for POST.
Would be very useful for bots to be able categorize users based on boost count, boost length, etc, etc.
Query params have worked with POST for me. Is this intended?
This seems like a duplicate of #1182. I'd recommend showing your support over there if you have anything to add to that discussion.
See also #1172, which has some other relevant discussion about the booster role.
It is more intuitive to subscribe to specific events rather than these intents. Given the number of events can each reserve a bit position (bit flag) in a 64 bit integer with room to double (?) the number of events, it would be great to see that change in v7.
However, the current set of events does not separate "direct message" related events from "guild related" events. If I were to make a change here, I would simply give the "direct message" events different bit flags from the "guild rel...
Hello,
we are not able to mark images as spoiler on mobile devices (like the desktop feature).
Can someone make this features please ?
This repo is for discord's public API, for client feature suggestions try https://feature.discord.com.
@msciotti it OK, that now for users locale returning null?
OAuth stopped working May 29th on my site. After investigating I found that the API was returning a error not seen before. Nothing changed on our end as far as I'm aware. I added a screenshot of a POST request that I made and the error the API returned. You can clearly see that the 'code' field that the API says is missing is in the request.

You need to send those in the POST Body, not the querystring params.
I had this same problem, so I tried to switch all url parameters to the request body and add the header 'Content-Type': 'application/x-www-form-urlencoded'. Now I am getting the following error back:
data: { error: 'invalid_grant' } }
Strange that the same parameters seemed to work in the url, but now that I try to pass them as request body, it doesn't work anymore..
You are probably sending them incorrectly. Make sure you use the http client properly such that you're not sending json by accident. You can use requestbin to test what you're sending. It should be a body that looks identical to the query like redirect_uri=...&code=...
Member Updates don't seem to include joined_at.
If this is intended, it might be worth documenting it.
According to the docs on establishing a voice connection (here), you should receive two events from the gateway, a Voice State Update, and a Voice Server update, both events are needed to establish a voice connection. However, if the current user is using intents and the intent GUILD_VOICE_STATES is not specified, then the Voice State Update containing the needed ses...
The session_id in the voice state is always identical to the session_id you receive with the READY event.
The session_id in the voice state is always identical to the session_id you receive with the READY event.
That is good to know.
The docs say we are supposed to wait for both events before attempting to connect. If I use the session_id from the ready event, is it safe to connect to the voice gateway after only receiving Voice Server Update since I will not receive the Voice State Update.
is it safe to connect to the voice gateway after only receiving Voice Server Update since I will not receive the Voice State Update.
Yes, I think that should be ok. But I agree that the API should send this event regardless of intents, just like member events for the bot.
const Discord = require('discord.js')
const Client = new Discord.Client()
const Constants = require('discord.js/src/util/Constants.js')
Constants.DefaultOptions.ws.properties.$browser = Discord iOS
Client.on("ready", () => {
console.log("Loading status..")
Client.user.setActivity(!help for commands, { type: 3, browser: "DISCORD IOS" });
});
I'm in the process of adding support for the available flag of the Emoji Object to the JDA library.
But for that to work would I need to know, if a GUILD_EMOJIS_UPDATE event is fired when the boost level (boost tier) changes (i.e. from Level 2 to level 1)
Not sure why there is a sentence about contacting discord staff for viewing store page since it's visible by making a store channel. Replaced it with info about making a store channel.
You don't have to make a store channel; if the store page is enabled in the developer portal, then you can just click the "open store page" button and it will open the direct page.
Just to tac onto what Advaith1 inputted, A store page can be viewable externally via Visit Store Page hyperlink in your SKU settings:

Night has made a statement regarding it previously: https://github.com/discord/discord-api-docs/issues/1640#issuecomment-634344176
Thanks for letting me know that. Just added it in the pr.
for example, the VoiceState docs do not reference the VoiceState.self_video? property.
I think this falls under issue #1647. The v5 for voice is mostly for video.
These are inverted
| id | snowflake | the id of the user this nickname is applied to |
| nick | string | the user's nickname |
ive been running this bot 718935686941638709 on my pc for a few days, but at which point it started throwing invalid token errors.
I've regenned the token, multiple times and I've tried other code and other bots. It all works apart from this bot app.
I'm not really sure why this is happening and there is no chance of a token leak
Mate your bot just probably banned.
Mate your bot just probably banned.
i have not got an email though? i dont know why it would be it wasnt doing anything when it got banned?
Mate your bot just probably banned.
i have not got an email though? i dont know why it would be it wasnt doing anything when it got banned?
That is just my hunch. Without any details I can't guess any further.
Mate your bot just probably banned.
i have not got an email though? i dont know why it would be it wasnt doing anything when it got banned?
That is just my hunch. Without any details I can't guess any further.
What should i do?
wait for a dev to check and respond
ok thank you, will they be able to tell me why it was banned if it turns out it was banned
Im new to all of this so i dont want to be breaking rules, ive made sure im not spamming the api (i think,,,)
Hello My account has been hacked and the person has activated The two Factor authentification on it. Is there any way to find my account?
Hello My account has been hacked and the person has activated The two Factor authentification on it. Is there any way to find my account?
contact discord support
Hello My account has been hacked and the person has activated The two Factor authentification on it. Is there any way to find my account?
contact discord support
I already contact him but im still waiting
🙂
Hello My account has been hacked and the person has activated The two Factor authentification on it. Is there any way to find my account?
contact discord support
I already contact him but im still waiting
🙂
patience
Hello My account has been hacked and the person has activated The two Factor authentification on it. Is there any way to find my account? The password and the e-mail are the same .
Contact Discord Support, wait, and don't hijack a random issue.
how long does it usually take to hear back from a dev?
And if i were to make a new bot to test on would that get me in trouble?
Will i ever get my bot back?
I'm not sure, shouldn't chanel_id be channel_id?
| Channel Icons | channel-icons/[channel_id](#DOCS_RESOURCES_CHANNEL/channel-object)/[channel_icon](#DOCS_RESOURCES_CHANNEL/channel-object).png | PNG, JPEG, WebP |
I'm not sure if we want to do this quite yet because we don't officially support guild video for bots. I'll check
Apologies in advance for writing so much - I just want to make sure I've noted everything that might be relevant.
I've got a channel where members are denied the "add reaction" permission. A user with the permission has added reactions (paintbrush, clock, and zero in that order - all Unicode emojis) to that message, so that any user is able to add those reactions to that message. The system I have set up on my server is that when a user adds a reaction, my bot removes their reaction from...
I'm not sure if we want to do this quite yet because we don't officially support guild video for bots. I'll check
I just want to point out that self_stream is documented (https://discord.com/developers/docs/resources/voice#voice-state-object-voice-state-structure)
And bots can't stream either.
Hi, if I post my website link in my Discord server, it doesn't show as embedded (it works correctly with other websites). It doesn't embed any of the links of my website http://1up.wtf What could be the problem?
All the options to embed links are enabled in Discord and the website metatags are correctly set with Open Graph. Thanks!
Your host is returning us:
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://www.google.com/recaptcha/api.js?render=6LdZXJwUAAAAAE1ERIs8cDyw2wNhHNuM...
yes it should, though there's no guarantee it will occur since it's a side-effect task.
"intended" probably not, but due to the way the endpoint is built it works.. as always, you should implement according to the documentation as it may break if you don't
your bot was actioned by trust and safety, so you will need to reach out to our trust and safety team to appeal this: https://support.discord.com/hc/en-us/requests/new?ticket_form_id=360000029731
you should implement according to the documentation as it may break if you don't
I can't find where the documentation suggests it should be sent in the body, could you point it out? I think the problem of this issue was more that its not clear what "array" means for a query parameter.
my bot removes their reaction from that message and then processes whatever it needs to, so that only one reaction (the bot's) is on that message at any given time.
can you provide the exact API calls you perform for this operation? we have a service we recently deployed which optimizes message + reaction loads, which could be related. it's possible the act of deleting reactions somehow causes some sort of data race
you're right. that's not great, and the docs on these are wrong. will push some improvements + make sure we're allowing comma separated ids on the qs (which is what we do elsewhere).
Doesn’t the gateway drop self_video and self_stream in voice state updates and pretend they are false? Maybe you should add that.
I'm using the Discord.py library so according to this line, I'm running DELETE /channels/:channel_id/messages/:message_id/reactions/:emoji/:member_id, which the bot does every time it receives a reaction event referencing that message. I'll pull up the exact logs for you when it happens again - I don't have them to hand right now.
I don't have a channel/message ID at the moment sinc...
This object is the voice state you receive from other users; there's a separate object for sending the bot's voice state which does not contain self_stream or self_video
Oh, I see what you mean. NVM then, yeah this should be documented as all the voice state events for other users do contain self_video as a property.
I found this bug on Discord, according to the attached image. The bug appears when i open Discord on my cell phone and when i open it, if i try to enter a call, this bug appears. It also appears when i try to enter a call, even if it is not when i started the application.
My device is a Samsung a10.
My Discord is мℓ Fallen Angel 私#0666.
My ID is 611218831670640680

Your host is returning us:
<html>
<head>
<met...
You would have to contact your host and ask them to remove the captcha block for Discord to see your site.
Thanks so much guys!
Scarica Outlook per iOShttps://aka.ms/o0ukef
Da: ariel w. notifications@github.com
Inviato: Tuesday, June 9, 2020 8:30:24 AM
A: discord/discord-api-docs discord-api-docs@noreply.github.com
Cc: Francesco f.foresta86@gmail.com; Author author@noreply.github.com
Oggetto: Re: [discord/discord-api-docs] Unable to embed links of my website (#1731)
You would have to contact your host and ask them to remove the captcha block for Discor...
Sorry to bother you again.
We have identified that our host was placing a CAPTCHA in front of our website. This has now been disabled and so traffic from discord.com should no longer be blocked by CAPTCHA.
Could you please check again and let us know if it is still running into stackProtect?
Thanks again for your help :-)
you mention that:
so that only one reaction (the bot's) is on that message at any given time.
Are there then 2 reaction on the message?
- One from the user with permission to add emojis, and
- another from the bot?
Or is the bot the one that adds the emojis?
Sorry to pry but need the get specific this bug is nuanced.
The bot is the only one that adds reactions to the message. Any other reactions, the bot will remove.
No need to apologise - I understand. I'm still yet to have the issue repeat again so I still can't link you to any specific messages, but I expect it to happen again within the next day or so.
@4Kaylum when it does happen could you ask the user:
- what emoji count they see
- try again 3 secs later, if that doesn't work refresh their client and repeat ^?
To add to sam's response, if the refresh their client and the reactions are still on the message and they are unable to react we'd need to have the channel id + message id so we can query the service directly to see why inconsistent data is being retrieved.
Your host is still returning us this same error.
Improper token has been passed.

You're putting your client secret in. You should regenerate that and then go into the bot tab and use the bot token instead. Never share your secret or token online, like this.
Thanks Zack, I'll check again with the host. Is there a way for me to generate the same report in order to see the error so that I avoid bothering you every time?
Along with what Minn said, for support with discord.py (and not discord's raw api itself) you should goto the discord.py support guild at https://discorg.gg/dpy rather than this repo for Discord's raw api.
You're putting your client secret in. You should regenerate that and then go into the bot tab and use the bot token instead. Never share your secret or token online, like this.
You're putting your client secret in. You should regenerate that and then go into the bot tab and use the bot token instead. Never share your secret or token online, like this.
Okay Sorry
But how to solve this problem ?
- Go to https://discord.com/developers/applications and click your application.
- Under the "Client Secret" option, click Regenerate - since it's been posted online, you'll need to reset it.
- Now on the left side of the page, click Bot.
- Find the link that says "Click to reveal token" and click it.
- Use that value to log in to the bot.
- Go to https://discord.com/developers/applications and click your application.
- Under the "Client Secret" option, click Regenerate - since it's been posted online, you should reset it so the old one isn't usable.
- Now on the left side of the page, click Bot.
- Find the link that says "Click to reveal token" and click it.
- Use that value to log in to the bot.
Thank you Sir/Madam problem solve
@advaith1 We asked them and this is the reply. I'm really sorry to bother, but we want just to resolve this :-(
I had this same problem, so I tried to switch all url parameters to the request body and add the header 'Content-Type': 'application/x-www-form-urlencoded'. Now I am getting the following error back:
data: { error: 'invalid_grant' } }Strange that the same parameters seemed to work in the url, but now that I try to pass them as request body, it doesn't work anymore..
Hey I had the same issue and here is an easy way to fix:
let data = {
'client_id'...
I'm using Java 14 and getting the issue too.
Private bot for 2 guilds only, around 100 users...
Like I get in the call I get in the game and sometimes it comes out that no one excludes from the call or I get out
This repo is only for the API. For other support, go to Discord Support
For the Modify Channel params table, it seems inconsistent to list all guild channel types for nsfw but only list voice for bitrate; iirc bitrate can be technically set for all channel types but they only affect voice channels, and nsfw can also technically be set for all channel types but only affect text and news channels. It would probably be better to only list the channel types which the param actually has an effect on.
The pseudocode for the permission overwrites says that a role has a allow and deny value but i only got one called permission.
I think i spotted my error. I think that the pseudo code is really hard to read and missed something there.
same here, could someone help?
You can simply send the same presence again in some interval. That will ensure your presence doesn't get removed permanently.
I'm trying to add a bot integration that will allow me to remove users by email addresses, but as far as I can tell, the bot API doesn't provide a way to do this.
E.g. getting the list of members for a guild doesn't include email in the response, so I can't enumerate guild members to map an email address to user ID.
An alternative would simply be an API call to remove a guild user using the email address instead of user ID, so that I don't need to enumerate all guild members.
Such an endpoint would provide a means by which to discover a Discord user's email without their consent; this is a very explicit privacy concern on Discord's end. Retrieving a user's email can be done through OAuth2 with them explicitly authorizing your application to see their email (with the email scope). This requires the user's consent—this is a feature, not a bug.
If have error code 50007 in cmd how i change that to sent embed to that channel?
I know this error because user cloesd dm if cloesd dm how i sent message embed to channel?
reason: DiscordAPIError: Cannot send messages to this user
at C:\Users\nawap\OneDrive\Desktop\Discord\bot all\emojibot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:79:15
at C:\Users\nawap\OneDrive\Desktop\Discord\bot all\emojibot\node_modules\snekfetch\src\index.js:215:21
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
name: 'Dis...
I know this error because user dm closed
if dm closed how i sent message embed to channel?
This is an issue for discord.js and not for this repo. You should take this issue to either their github or server.
There is no intention to build this. Leaking someone's email is a serious privacy violation and this provides venue to unintended information disclosure.
@foresta86 I don't believe Discord uses any static range of IPs. As far as I'm aware, Discord creates and destroys servers as they need them, meaning their IPs would always be changing, and any IPs that would always match all of them would probably match all of Google Cloud.
Your best bet would be to whitelist the user agent; then, if the user agent matches, you would return only the OpenGraph tags at the top of the page, which would prevent the rest of the site from bei...
Hello,
A bug report to let you know that between Jun 13, 2020 3:33:43 AM UTC and Jun 13, 2020 3:33:49 AM UTC, I've received 3 VOICE_SERVER_UPDATE with null endpoint which should not be possible.
Example:
{"t":"VOICE_SERVER_UPDATE","s":477069,"op":0,"d":{"token":"f8eb804ee40ebf3d","guild_id":"691022703368601651","endpoint":null}}
This has been an issue for a very long time. The gateway is supposed to send you a second VOICE_SERVER_UPDATE once it established an endpoint. If you get a null endpoint or invalid payload you should simply ignore it.
Endpoint: https://discordapp.com/api/guilds/{guild.id}/widget.png
Working:

(Discord Testers) (Created 6/27/2016)
Not Working:

(Test Server) (Created 6/13/2020)
Did you enable the widget in the server settings?

I was doing a private bot (721369935590326322) and I got banned after it joining my own discord server???
@jhgg can't you help me here, pal?
For support, you should use this form: https://dis.gd/support
and how can I do that, please help?
Hmmm. This hasn't been documented as nullable I guess. But a null means that the voice server you were allocated has gone away and we are trying to reallocate the server on our backend.
I would drop the "it should be ignored" recommendation and replace with "you should attempt to disconnect from the currently connected voice server, and not attempt to reconnect until a new voice server is allocated" or something to that effect.
Will a new allocated server be notified by a new voice server update event?
Found an interesting behaviour when executing a webhook with wait query parameter as true and with including an avatar_url within it's payload.
The response payload (payload from MESSAGE_CREATE dispatch event as well) will contain payload['author']['avatar'] as the webhook's...
If you're using discord.js, maybe try something like this :
`Client.once('ready', () => {
console.log('Ready!');
setInterval(() => {
Client.user.setActivity(`${prefix}help`);
}, 60000); // every minute
})`
When making a PATCH request to https://discordapp.com/api/v6/guilds/{guild id}/vanity-url
with the body
{"code": "unclaimed_vanity_code"}
To a guild that does not have vanity invite features, the response is
{
"message": "Invite code is either invalid or taken.",
"code": 50020
}
instead of the typical code 50001 Missing access
@Noemai this is not what they are asking for, they are asking for a JDA way.
They never mentioned what lib, but lib support should be in the lib's server, not here
Couldn't you provide an API that returns OK if the email doesn't exist? That would prevent information disclosure, and allow me as an admin allow my automation tools to work. Discord is not my main identity provider, so there is currently no way for me to manage my Discord guild, as there's literally no way to map my membership list to Discord users. I want to be able to remove users removed from my team's membership.
As an alternative, is there a way I can automate a one-time invite to a specific email and get an id back that I can then store in my database, so I can remove users later?
Couldn't you provide an API that returns OK if the email doesn't exist? That would prevent information disclosure, and allow me as an admin allow my automation tools to work. Discord is not my main identity provider, so there is currently no way for me to manage my Discord guild, as there's literally no way to map my membership list to Discord users. I want to be able to remove users removed from my team's membership.
That's exactly information disclosure. You as an admin can see if that i...
As an alternative, is there a way I can automate a one-time invite to a specific email and get an id back that I can then store in my database, so I can remove users later?
you can force users to join the server through OAuth instead of an invite link, and collect their email from it
what emoji count they see
I see one emoji on the message. When I try adding the paintbrush emoji to the message, it displays 2 briefly until it's removed again. The bot isn't removing this reaction - it doesn't receive the on_reaction_add payload.
try again 3 secs later, if that doesn't work refresh their client and repeat ^?
Trying again and refreshing the client doesn't change the issue.
we'd need to have the channel id + message id
719610039244947519-719610040142659717
Also, the Nitro Booster role IS marked as Managed in the API.
You can narrow it down by checking for roles that are managed, have more than 1 member, and if it does have 1 member, that member isn't a bot user.
This doesn't work all that well on partnered YouTube or Twitch channels with their roles also being marked as managed, however you could check 2 current boosters (with the least amount of roles) for any managed roles in common.
It would be useful to have a thing for this, would s...
Considering it's a spider, you could allow Spiders or allow "Discordbot 2.0" to bypass it
The auto-removal seems to be a result of optimistic writes (we assume the request will succeed, and then revert if we get a bad response). This could happen if the server is busy and the request failed.
Just took a look and it does seem that we have a 3 emojis on the message, with a single count for each. All by the same user.
However the message itself is only aware of 2 reactions on it...
I can't see any recent changes that might've effected this recently, and logic seems to guard co...
There's a couple issues we've found that attribute to this condition:
- reaction adds/removes can become inconsistent within our database during database availability issues
- a slight change in how we serialize reactions in messages
The first issue, which leads into the second issue, will be fixed in the next API deploy. In the meantime, you should be able to have your bot unreact or re-react the paintbrush as a fix.
Thanks for the update. Do you have an estimate of when your next API deploy might be, so I can flag this to your attention again if your fix doesn't work as expected?
I wanted to ask how would I be able to differ between permission for roles in a channel in the Discord API.
I also found this cool Website, which can calculate the permissions. So exactly what I want to know. Maybe this helps and somebody can explain how to reverse it: https://discordapi.com/permissions.html
For example:
This is a response Im getting for the permissions in a channel:
[
{
"type": "role",
"id": "548978033365876748",
"deny": 2048,
"allow...
https://discord.com/developers/docs/topics/permissions Should help you out. It's a bitwise integer.
I'm unable to see my applications and create applications on [https://discord.com/developers/applications] Can someone help? Thanks,
The API is having issues
It'll get fixed eventually
And not show nitro badge
No nitro badge is displayed
Yes it will not just please wait a while and it will be back up :)
Thanks, everyone for the fast response! I'll keep my eyes peeled on https://status.discord.com. Thanks again!
Is the GUILD_EMOJIS_UPDATE event itself relegated to "not guaranteed"? Or is it just the dispatch of GUILD_EMOJIS_UPDATE due to Boost changes that is considered a side effect, thus not guaranteed to have a dispatch?
Trying to get a concept of how dependable (or lack there of) it is that the even will be dispatched.
When you have a nitro, you can change people without Nitro, first you pick the hashtag of the person who have not a nitro, then the other person pick your own nickname, and then it changes automatically the other person's hashtag.
I am also having this issue, with v12.2.0 of discord.js.
Currently there is no way to track how many times a user boosts a server. The closest I was able to get is in the message event. When Discord's system generated message sends to the channel, it's missing content, that can be used to potentially parse the number of boosts. I think this would be beneficial information to have to be able to provide rewards to users based on number of boosts and give them an incentive to boost.
type: 'USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1',
content: '',
...
The details and the screenshot you sent are for 2 different messages; the number will be the message's content if it has more than 1 boost.
https://discord.com/developers/docs/topics/permissions Should help you out. It's a bitwise integer.
Ah yes, that solved it. Thanks!
Hello,
I wanted to ask if its possible to get all Members in a guild (even the offline ones) with a "Client" Account.
I know that you can do this:
{
"op": 14,
"d": {
"guild_id": "GUILD_ID",
"channels": {
"CHANNEL_ID": [
[ 0, 99 ]
]
}
}
}
But this won't get the offline members. Does anyone have any ideas on this?
I mostly writing this so people who run into the problem I had will google this and see this request. I was using the Authorization Code Grant route and kept getting the errors 'invalid-client' and 'invalid-grant'. The reason why was because I was not sending properly formated form data, which I did not guess from the error messages given.
Solution: Use fetch or axiom, but make sure you set the body to a URL search param string or URLSearchParam object like below. If you do this, both w...
How this could be made simpler? Just make this API route accept JSON data. We aren't posting any large files there no reason for this post to require form-data formate or add errors that specifically tell the user when they sent invalid form data instead of the vague errors that it sends right now.
OAuth2 is an RFC, primarily RFC 6749 (although there are some additional ones we support from the OAuth2 WG, like token revocation and PKCE). The specifications do not permit JSON values, only...
Maybe the note could mention error cause could be titled as authentication errors in the response?
For the fact, using a selfbot is against the discord tos and won't be supported.
Well, I can definitely see the "concern" to the subject of a duplicate issue, but I believe the former (#1182) is mainly focused on providing a single property which is to display the amount of boosts a member has given to a guild.
However, the issue I'm opening up is to mainly focus on completely opening up the mentioned endpoint to bots so bots have access to all relevant data concerning a guild's boost status; each individual [boost] id, for example.
I make the request with this config
$hook_json = json_encode(['message'=>$options['message']],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
$ch = curl_init();
curl_setopt_array( $ch, [
CURLOPT_URL => $options['url'],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $hook_json,
CURLOPT_HTTPHEADER => [
"Length" => strlen( $hook_json ),
"Content-Type" => "application/json"
]
]);
$response = ...
You're not using curl correctly. Headers should be an array of strings like this:
curl_setopt_array( $ch, [
CURLOPT_URL => $options['url'],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $hook_json,
CURLOPT_HTTPHEADER => [
"Length" . strlen( $hook_json ),
"Content-Type: application/json"
]
]);
You're also not handling the error code returned by curl_setopt_array. I recommend you [read the docs](h...
Begin Guild Prune (POST /guilds/:guild_id/prune) seems to take a reason for the audit log entry. However, it only seems to accepts reason as a (currently undocumented) body parameter, and seems to ignores the X-Audit-Log-Reason header, unlike other endpoints that accept reasons.
As an alternative, is there a way I can automate a one-time invite to a specific email and get an id back that I can then store in my database, so I can remove users later?
you can force users to join the server through OAuth instead of an invite link, and collect their email from it
Is there some example documentation of how this is done?
the reason being broken there is probably because prune runs async and the header lookup is out of scope.. we can probably fix that behavior.
imo the standardized header is preferred usage here for bots.
we can probably set the avatar to null in this condition, but since it's an async update it probably will pop no matter what
this isn't quite a bug, but the error returned doesn't make much sense
Because this issue not occurs when wait query parameter is set as false, I am pretty sure it could be fixed easily by looking into what both case does differently.
No, it can’t be "fixed easily." As stated prior, images are fetched async. If you explicitly request wait you are telling our API “hey, give me a synchronous confirmation of this message” .. so we do that with some compromises to achieve performance, and everything else happens as a follow up. Waiting for external data will never happen synchronously, thus not fixable.
Shouldn't it be correct in the MESSAGE_CREATE event though?
No, as a confirmation of a message being sent includes it being dispatched to clients.
No, it can’t be "fixed easily." As stated prior, images are fetched async. If you explicitly request wait you are telling our API “hey, give me a synchronous confirmation of this message”
@night, your answer only gives birth to even more questions:
Can the server answer only synchronously?
If the server can answer asynchronously, and wait causes the response to be answered synchronously, then add an other query parameter instead?
If the server can answer asynchronously, then...
Thank you to everyone who commented and let me know about the issue! The discord community is just amazing :)
- [ ] discord there is a bug that where hackers are creating. We must ban all of the hackers.
This mans thinking millenials ahead! I say he get hired to discord immediately to help ban all the hackers 🙌
Obviously a troll issue, you really shouldn't create troll issues
This issue was created 6 hours ago, the account was also created 6 hours ago
Obviously a troll issue, you really shouldn't create troll issues
https://cdn.discordapp.com/emojis/631219821744357416.png?v=1
Useful, but easily abusable, if you can use emotes from any server (think: people's private servers they don't want their emotes leaked from), someone is bound to find emojis from other servers by complete chance.
TL;DR: Good idea at, but could be used badly
You can already load the image for any emoji with just the id, and you would need the id to send it
Maybe if over 1k members are going to be purged, emit a GUILD_MEMBER_PURGE event with the count of users purged, and maybe the userids of those users (unless over <someNumber> users are being purged)
Ooh, a good one, would this also be implemented on the Desktop/Mobile Clients?
Fair point, I guess it's already abusable
If this is done, do it for webhooks too.
@TapuCosmo It was added for webhooks a few weeks ago
So webhooks can now use any emojis without needing a bot token?
Theres been a glitch that when i try to save the public server description it dosent get saved. Its weird. I have tried several times and my friends tried too
just wanted to note that many people have reported this issue
Webhooks require to have the emote on the same guild they're created in.
no webhooks can use all emoji from all guilds, it does require the everyone role to have use external emoji perms in the channel
no webhooks can use all emoji from all guilds, it does require the everyone role to have use external emoji perms in the channel
My personal experience tells me otherwise.
I grant usage of external emotes, yet the webhook can't display any that aren't in other Discord Servers.
Can we please keep this thread on the topic of allowing this for bot users, and not webhooks?
Hello,
I am building a combination bot/website for my guild that allows users to refresh the page to show a completely random quote from a random user in the guild (for the lulz, basicaly). I was hoping to use the search endpoint to allow visitors to specify criteria like before/after dates, specific users, etc. Unfortunately it appears that bots cannot use the search endpoint; with discord.js 11.1 using the .search() method, I get:
{ DiscordAPIError: Bots cannot use this endpo...
If i downloaded gamesdk, UpdateLobbyHandler on sdk doesnt contains new Lobby arguments.
And some typo misses lobby.id -> lobby.Id
Original code from https://discord.com/developers/docs/game-sdk/lobbies#the-sdk-way
var lobbyManager = discord.GetLobbyManager();
// Create the transaction
var txn = lobbyManager.GetLobbyCreateTransaction();
// Set lobby information
txn.SetCapacity(6);
txn.SetType(Discord.LobbyType.Public);
txn.SetMetadata("a", "123");
// Create it!
lobb...
My server, which is public with an invite to a store channel used to allow people to lurk w/o an account. Now, it says enter username which registers a un-claimed account. The exact same invite used to allow viewing the channel without registering or anything. The invite is: https://discord.com/invite/88NNfQR
Is this bug back? I have a bot ("Discord Me") that was kicked from my server but now it's role is left behind and I do not have access to delete it.
i get this in the image : https://ibb.co/1shh2Qh
Ik this is dead, but I would say that an option on the RPC api to point the user to that channel on the guild would be the best. The add members endpoint does it silently and nothing happens to the client except for the extra guild on the guild list. It’s probably more work for discord to make a gateway event that’s specifically for that purpose. Maybe a one time use token that’s granted when the member is added. The token could be used with a rpc endpoint that lets you point to the newly add...
Should be reported as a bug in the DTesters server, this isn't a documentation issue
@bsian03 But it is about the Developer Portal site, which means it's allowed here. Or at the very least, similar issues have been allowed here before.
similar issues have been reported on dtesters though? thought that was the process it had to go under
Currently, if you use the guild members intent, but not the guild presences intent, you will not be sent the guild members when connecting to the gateway. This is an annoying feature, as for many, having all of the members in cache can be important, and to do so, you are required to fetch the members of every guild. This is a lot of calls to the gateway however, and slows down the start up of the bot by quite a long time.
Another issue to be pointed out, is that some may want the ability t...
@bsian03 Well, I've never seen any issues related to the Developer Portal itself get turned down here -- though I also see very few issues here regarding the portal in the first place. Perhaps Discord staff just don't mind which it gets reported to? Perhaps if any Discord staff reply to this issue, they could help clear that up.
I've found out that whenever a channel has a user/role (not tested but I presume it is the same) added to a channel's permission overwrites it doesn't create audit log for update channel permissions, instead it is considered a update channel, which I think is incorrect, however after the user/role object(?) is added to the permissions and a change is then made it creates an audit log for update channel permissions providing information which permissions were granted/denied for the...
Nvm, I completely missed the "created channel overwrites" and "deleted channel overwrites" and was too focused on "update channel overwrites", there is no issue on this part.
Playing around with endpoints I have found several things
Using Create Message endpoint
Sending an empty embed removes directly, as if you didnt specify it:
{
"content": "Test",
"embed": {}
}
Output:

But if you specify anything , even if its invalid, this will happen:
{
"content": "Test",
"embed": {"a":"a"}
}
```...
This doesn't really explain anything
The other ones don't really explain anything either, like "guild is public", so I assumed that's how Discord wants it
I think we should stop this habit of recursively describing guild features and some other properties. "Community - Guild is a community" is useless. What does is mean to be a community?
Perhaps a subset table or hyperlinks to resources that give further insight on per guild feature would suffice?
At this point you might as well remove the description column and just list the feature names. This shouldn't become the standard.
You can also send
{"rich": true}
``` for an empty embed
Turns out this still is a thing. I checked the get emojis guild endpoint does not return managed emojis.
I had this same problem, so I tried to switch all url parameters to the request body and add the header 'Content-Type': 'application/x-www-form-urlencoded'. Now I am getting the following error back:
data: { error: 'invalid_grant' } }Strange that the same parameters seemed to work in the url, but now that I try to pass them as request body, it doesn't work anymore..
Hey I had the same issue and here is an easy way to fix:
let...
Hello @night , I'm encountering this problem too with certain user accounts. Haven't reproduced on demand (yet), but a commonality appears to be that it fails on a mobile device but it works on a laptop, and that their Discord authorization screen does not show the "Signed in as" and "Once you authorize, you will be redirected to" lines. Does that gives you any clues?
There is something in these user accounts causing the problem. I even added a 1 second delay between receiving the a...
Unfortunately you will need to ask the user to provide a video. There's nothing wrong with the user's account, as it works on a laptop. It's either a device specific issue, a mobile app issue, or their mobile device/app is out of date.
It is possible to bypass the empty message check when editing messages by including allowed_mentions in the edit message payload.
This fails
{"content":null,"flags":4}
This fails
{"content":null,"embed":null,"flags":4}
But this succeeds
{"content":null,"embed":null,"flags":4,"allowed_mentions":null}
And the last content will leave an empty message.
{"content":null,"allowed_mentions":null}
Will also not fail and leave an em...
FYI I tried changing the description thru https://discord.com/developers/docs/resources/guild#modify-guild endpoint and it still fails to do so.
Server templates should be able to include bots that are in the origin server.
It would be nice if some form of 'state' parameter could be included with the template which bots could use to configure the new server, such as a default prefix.
If multiple bots can be included per server, this state should be able to be settable per bot, so multiple bots can read different states for them automatically.
Bots should request/inherit their permissions from their managed roles from the origin...
It should be giving an invalid redirect url error


maybe the state parameter is a bad idea, but maybe an optional argument for the guild_join event, with the guild id the template was made from?
That would probably also work for that
Extension to Taarek's comment: this also works with bots that are set to private!
It is fine until the template has a malicious bot hiding within a list of like 40 bots you do not realise as you gloss over it.
I'd imagine 40 bots is probably too many to include automatically at once, it'll probably be limited
that specific error can only occur if the code was not found. authorization codes expire after 100 seconds or after use.
End-users always complain when a bot is offline due to whatever reason.
Most of the time it's scheduled maintenance or a VPS outage, (sometimes the devs just don't care /shrug)
It would be great, if each member of a team could directly in the Discord UI (not the dev portal) mark an application as scheduled for maintenance/hit by an outage.
This should be able to be set:
- directly in the UI
- via API requests
- via webhook payloads (eg. automation with uptimerobot)
See some con...
Requesting both /api/invites/:code and /api/invite/:code returns the same content, but only /api/invites/:code is documented in docs. Is that intentional?
I feel like either second endpoint should be also documented or removed.
I'm running into the exact same issue from #1487 but since that issue is closed I decided to open a new one.
I use Authorization: Bot header in my requests.
When requesting, for example https://discord.com/api/invites/mlp I get the following information about ratelimits and also all json content about invite is returned:

However, after about 10-11 requests to the same endpoint within 4-5 seconds I seem to be blocked by cloudflare and get error 1...
yes but here code is 100% fresh
I made requests right after the code was born.
This error precisely because of an extra slash in the redirect_url.
Cloudflare bans and limits are separate from the API's internal rate-limit and are IP based instead of application-based.
So is there a way to avoid CF bans? I assume those can be two different things, most likely IP based, but that Cloudflare ban makes it even impossible to use endpoint more than few times, which I need.
Old descriptions set a while ago seem to persist, but you are unable to change the description.
As the title suggests, it would be best to add an bulk-add reactions endpoint this would be better than the current system for bots.. to have rich help menus and not have the end-user wait for all of the reactions to get to the message. (sounds like a per-developer problem right?, well no) This would free up the rate limits for add-reactions and make less requests to Discord to add reactions to a message. Which over time would be better for everyone imo.
Ah my bad, I'll go ahead and close the issue. 👍
Hello There Discordians,
I personally don't recommend bolding the Field Titles in the Embed. I like the previous way because It was dark, and simpler.
Please fix that out, Thanks for the time!
The previous design made the field names and footer unreadable on dark theme due to their low contrast.
The previous design made the field names and footer unreadable on dark theme due to their low contrast.
That maybe true. But now it's more bad when it displays.
We cannot use ** to High Light Texts when the Titles are bold. That's very bad.
But now it's more bad when it displays
I don't think it can be "more bad" than not being able to read it.
It might help if the font weight was decreased slightly whilst keeping the same colour?
It might help if the font weight was decreased slightly whilst keeping the same colour?
That's a good point. You caught it correctly. Discord can keep it dark like the footer, But with increased font sizes. Awesome and Better!
It might help if the font weight was decreased slightly whilst keeping the same colour?
I agree and also should have the ** bolding thingy.
Well, I am still saying : That's a good point. You caught it correctly. Discord can keep it dark like the footer, But with increased font sizes. Awesome and Better!
Ideally they would just switch to Adaptive Cards
they probably did this so managed emojis don't show in the Emojis tab in server settings
Ideally they would just switch to Adaptive Cards, which would allow developers to have a lot more style and design choice with the embeds
Absolutely. But, lot more style is not better with bolded Field Titles.
The documentation just says "The maximum request size when sending a message is 8MB." This information probably needs to be more clear on what it's trying to say.
what isn't clear about that?
Someone in the Discord API server asked "Thanks, so I can include 5 images on the same message? Does the filesize limit apply to all of them together?"
Though one could argue "maximum" implies all files, this still needs to said explicitly.
I can't confirm whether that's true or not at the time of this writing, but I will test it.
I assume the docs are correct and the limit applies to the whole request, including all files, the text, and any other metadata.
However, it should probably be updated to mention the increases given by server boosting.
Ideally they would just switch to Adaptive Cards, which would allow developers to have a lot more style and design choice with the embeds
Absolutely. But, lot more style is not better with bolded Field Titles.
did you even bother to research my suggestion? Adaptive Cards is a complete redesign. Your problem will be a non-issue, it doesnt even have traditional fields.
Here, make sure you give it a look over ;) Its actually really awesome way to bring interactivity for bot...
Using a versioned route (like api/v6/invites) seems to be better at not getting cloudlfare banned
There are no plans to revert it the way it was before. The old design was barely readable for a lot of people and honestly lingered around for longer than it should.
We may tweak the font weight to be less heavy, but the title will definitely be more than the field value.
@msciotti should I remove PUBLIC and PUBLIC_DISABLED and update existing other PUBLIC references to COMMUNITY? (btw is there a replacement to PUBLIC_DISABLED? there doesn't seem to be one in the client)
It might also help if an exact number of bytes were given, and to say if it covers the entire payload or just the attachments
Adding to this if the goal of discord is to make empty messages impossible there is another way you can make pseudo empty messages.
- post message only containing embed
- edit the meesage to remove the embed with the
SUPPRESS_EMBEDSflag.
It might also help if an exact number of bytes were given, and to say if it covers the entire payload or just the attachments
It does give you an exact number of bytes (8MB) and it tells you the limit applies to the request, not the body.
The Implicit flow was a simplified OAuth flow previously recommended for native apps and JavaScript apps where the access token was returned immediately without an extra authorization code exchange step.
It is not recommended to use the implicit flow (and some servers prohibit this flow entirely) due to the inherent risks of returning access tokens in an HTTP redirect without any confirmation that it has been received by the cl...
Yes, we should probably document PKCE since we support PKCE and it's generally more secure for browser-only and native applications. But, I do disagree that implicit auth is insecure so long as you're operating over TLS with a properly configured client. Their primary concerns against implicit auth are mostly misconfiguration leading to:
- Replay attacks
- Client binding to requests
- Leak of access token through improper redirects/referrers
The only real major concern in this list fo...
Appreciate the response. So for a client app that I'm working on, can I continue to use implicit grant?
Looks like setting description is now tied to discovery instead of being a community/public server, and it can now only be set in the client in the Discovery tab, so this is likely intentional.
Looks like setting description is now tied to discovery instead of being a community/public server, and it can now only be set in the client in the Discovery tab, so this is likely intentional.
If this is the case, would it be possible to remove the existing description then? My server is for my bot and it had been auto updating the description with stats but now it is outdated and I can't change it or remove it.
This PR adds the missing lock_permissions value you can use when patching channel positions to sync text/voice channels permissions to the parent category, if any
Question: Is this how we're supposed to sync up channel permissions when setting a new parent for a text/voice/store/news/whatever-future-type channel? Should this lock_permissions be suggested to Modify Channel?
Before I dive into it. I am fully aware of the API being eventual consistent, so please read the entire issue instead of just quoting that line. :)
So the past few weeks (like a month or so). I've noticed that sometimes all bots in a guild won't receive GUILD_MEMBER_UPDATE when they changed username (unsure if avatar or other stuff triggers this issue too).
I most recently experienced this in the Rythm support server (server ID 231471142685245440) with the user 498397007858106368.
...
Today, I encountered an issue that I believe is a bug as I haven't seen any mention of this behavior in the documentation. I believe this is a very important issue as role positions are very important for almost any moderation bot.
One of the bots servers(newly created), the bot was not giving any roles. After a bit of confusion and debugging, I realized the roles had the same position. This was breaking my code because I first check if the bot's highest role has a higher position then the...
This should be documented, but things with the same position are sorted by their id.
Is the user definitely a member of the server at the time you expect the update? Is their status offline/invisible?
Addition: As of 6/30/2020, the public option disappeared from the client, but the community and public flags are still on the guild. Also, announcement channel cross-posts still show view server, but the option hangs indefinitely, and if you look at the requests, the api returns a 404 for the lurking endpoint.

It gets stuck like this ^^
, or descending order (higher ID integers being on the top)?
User 498397007858106368 is not in the server 231471142685245440. If you have timestamps etc we can check user logs to see when they left, but in general maybe they were not in the server when the user update occurred.
I kicked them from the server at around 2.57 PM UTC today because they broke their rules.
I do not have a timestamp when the event for guild member update should have fired, because there is now way to log it without the event.
We are starting a migration that changes lurking and previewing to being on Discoverable, and yes Discoverable will open to everyone in the future, not just Partner or Verified servers.
Public is going to be deprecated. In place of it, will be Community. The product rationale is that we realize the features that we were building for communities were not just for public communities. Many communities prefer to be private and control fully who gets to join their server. So it didn't make...
Will discoverable still require 250 members and activity? or will there be a level of "discoverable but not showing in discovery"
@rickling oh I see, thanks. Do you have any estimate on the duration and how long this takes to roll out?
I'm very disappointed the hackers were never stopped.
I'm very disappointed the hackers were never stopped.
monox
@rickling Thanks alot for the update!
Theres a hacky way to achieve this right now, by setting url to twitter :)
{
"embeds": [
{
"url": "https://twitter.com",
"description": "Freddy likes dogs",
"image": {
"url": "https://snworksceo.imgix.net/dtc/10ec0a64-8f9d-46d9-acee-5ef9094d229d.sized-1000x1000.jpg?w=1000"
}
},
{
"url": "https://twitter.com",
"image": {
"url": "https://sn...
b41f189 ordered list spacing - msciotti
8d65af6 unordered list spacing for policy - msciotti
0c11d4e push effective date - msciotti
A more formal notice will be sent via email and system DM!
TOS enforcement date is set to august 15 because we say 30 days notice and want to give that time to send out the formal notice.
2c8f554 2020 Developer TOS and Policy Update (#1780) - msciotti
@night You may send the system DM and email whenever!
While reading through the new terms, noticed someone forgot to have a copyeditor check this. 🤣
I may be incorrect, but I believe a comma should never be added before the first item in a list.
I may be incorrect, but I believe a comma should never be added before the first item in a list.
You're right. Misread it.
This is not a correct correction. The current language is correct.
Now that the language of the new Developer TOS from #1780 requires a privacy policy to be provided, I'm wondering if there'll be a change that allows developers to provide a link to that privacy policy to the end user when they add a bot to their server.
I'm assuming by this you mean specifically for bots? Or does this apply to regular users accessing the API through the official client/game SDK?
Question about "client IDs" in 4c:
Developer credentials (such as passwords, keys, and client IDs) are intended to be used by you and identify your API Client. You will keep your credentials confidential and make reasonable efforts to prevent and discourage other API Clients from using your credentials. Developer credentials may not be embedded in open source projects.
Bot invite links contain a client ID. Should we assume that it is okay to share a client ID in this form?
You will comply with all applicable privacy laws and regulations including those applying to personally identifiable information ("PII"). You will provide and adhere to a privacy policy for your application that uses the API (your “API Client”) that clearly and accurately describes to users of your API Client what user information you collect and how you use and share such information with Discord and third parties.
For this section, what is considered a privacy policy? Secondly, if a b...
Does this mean that we're not allowed to post our client ID to a bot list website, for example to post our server count?
@muddyfish you only use the bot's ID on bot list sites, not the client ID. No need to worry about that!
@muddyfish you only use the bot's ID on bot list sites, not the client ID. No need to worry about that!
The bot ID is almost always equivalent to the client ID, so I'm not sure what you're trying to say here.
The bot ID is almost always equivalent to the client ID, so I'm not sure what you're trying to say here.
Even if that were not the case, the authorization endpoint includes the client id. Which is usually used as an invite in the bot list.
"IDs" changed to client "secrets" in 6556637474b56d9236b905e66a74b44b4e1b2689.
I'm 18 on August 22nd and this comes into affect August 15th, meaning that there'll be a short period where I cannot use the API (this will affect bots I run and my test bot). Is there anyway I can work on Discord API related things in that gap with parental consent?
Is it possible to turn off moving animations (for example, gif) while browsing, until they are turned on separately for the whole screen?
This repo is only for the API, for discord support go to https://dis.gd/support and for feedback/suggestions go to https://dis.gd/feedback
OK thanks for the information.
The bug is that the position attribute for roles are not unique... I just ran into this when a bot joined a server and automatically created a role for itself at position 1 (just above the @ everyone role). The role above it was named "test" and when checking it's attributes ALSO had position 1. This bot role being added SHOULD have moved test to position 2, and the others above +1 in position as well.
Before adding bot:
`RandomGgames - 7
TestBot - 6
RSABot - 5
--- Start of Self Assig...
The bug is that the position attribute for roles are not unique...
As mentioned, this is not a bug. The sorting behavior is by position value, then a second sort is done by ID to resolve competing positions. Positions can have any value - they do not have to be unique, or contiguous. This applies to both role and channel positions. The correct means of sorting roles and channels is to use the associated endpoints to assert all role or channel positions at once. For channel positions, you...
@z64 I just looked through some of the documentation and the links you provided. Didn't see anything about the position being stated twice and the ID taking over. I feel like the ID takes over just based on the position in the role objects list as a fail safe. Though I could be wrong. Let me know if you can find it though, I might not have looked in the right place.
Either way if it's a fail safe/intended, it doesn't make sense. If it were not a bug, than why would moving a role fix it? Th...
The sorting behavior is not documented, but it is how it has always worked. It should be, as @devsnek mentioned.
Moving the role fixes it because the client does exactly as I described, asserting the position of every role in the list.
I'll have to test something tomorrow.... Too late for me unless someone else wants to test this: does creating a role by hand set the role positions correctly? Or are the positions also not calculated? If they are not set correctly when manually created, than I'll settle with it being called an annoying undocumented feature. HOWEVER if creating a role does update the positions correctly and it only occurs when a bot creates its own role when joining, I'm still going with it not working corr...
..it says on the documentation (Role Object) that colors and names are unique to the role..
This is also wrong, and needs to be updated.
Moving the role "fixes" it because the client does exactly as I described, asserting the position of every role in the list.
Out of curiosity why is this not also done when a role is created? Thereby validating the positions and not having this issue at all.
I change the bot icon but when I receive the message it comes with another icon
Thereby validating the positions and not having this issue at all.
The positions are not invalid, as I described. It is fully intentional that position values need not be unique or sequential. There is conversation about this behavior with the devs that dates back to 2016 - #174
There is no issue here, other than that this behavior should be documented.
According to the documentation the status code for sending a payload to the gateway before identifying should be 4003 with reason Not authenticated, but the gateway actually closes the connection with code 4002 and reason Error while decoding payload.
The payload in my case was a OP 1 Heartbeat since I figured sending a heartbeat right after getting a OP 10 Hello would be expected and I bet some other library developers would expect this too, which then left me puzzling why I was get...
The CDN docs state that The returned size can be changed by appending a querystring of ?size=desired_size to the URL. Image size can be any power of two between 16 and 4096 without mentioning any endpoint specific special cases for this which goes against the current behaviour for the embed/avatars/ endpoint which seems to ignore the size query parameter; is this an intended special case that should be documented or the size field being erroneously ignored?
The GitHub webhook always uses the GitHub logo and it can't be changed
I ask this here (again, although I have an answer on the Developer Discord) to have it here for anyone else that stumbles upon this.
Are there any specific requirements about how to "present" the Privacy Policy of the API Client (Your bot in most cases I assume) to the user, or is that up to the owner of the API Client?
Like is it okay to have it as a sort of pop-up on your client's website, that shows when clicking a text/button or would it need to be its own, accessible site?
Now that the language of the new Developer TOS from #1780 requires a privacy policy to be provided, I'm wondering if there'll be a change that allows developers to provide a link to that privacy policy to the end user when they add a bot to their server.
I personally see complications with this, as this would require to have the policy to be stored somewhere (like a website, or a message in a text channel) that not everyone would've access to.
My guess is, that you can simply add a comm...
I personally see complications with this, as this would require to have the policy to be stored somewhere (like a website, or a message in a text channel) that not everyone would've access to.
My guess is, that you can simply add a command to your bot, that links to the policy, or that prints it directly. Separately could you also make your bot send a message about you complying to its policy while using the bot (like a cookie notice on the website when you visit it for the first time.)
...
Finally, your suggestions don't address the problem that the issue addresses and that's the user should be informed of the privacy policy and any terms of using a bot BEFORE it is added to their server and the bot starts to receive user data. The only way to do that is to give notice to the user when they're adding the bot via the oauth flow.
I agree, there should be an area in the developer portal where we can specify a link to the privacy policy. This link could then show up on the oAu...
I ask this here (again, although I have an answer on the Developer Discord) to have it here for anyone else that stumbles upon this.
Are there any specific requirements about how to "present" the Privacy Policy of the API Client (Your bot in most cases I assume) to the user, or is that up to the owner of the API Client?
Like is it okay to have it as a sort of pop-up on your client's website, that shows when clicking a text/button or would it need to be its own, accessible site?
You ...
I made a dedicated page now that lists both the general ToS and Privacy Policy of both my bot and the API it utilizes (also by me).
And considering that all the info I save is only IDs of the guild and some text channels is it fairly simple for me to make the policy as (from what I remember) are those not considered sensitive information as it doesn't give any initial clue of who this might belong to.
This doesn't make any sense to me. Of course the link would have to be stored. How else would Discord be able to present the link to your privacy policy to end users?
I don't talk about how discord would present/store the info, but rather how you would do it.
Not everyone can have a dedicated website to just show this and not everyone wants to, so most people will either make a message about this and link to it, or a dedicated command listing this info.
Why wouldn't someone have ac...
This repo is for stuff related to the Discord API (the backend of Discord)
I would contact support @ https://dis.gd/contact about your issue since nothing can be done here.
I noticed today I received a new field I've never seen before guild_hashes. Should it be documented? Or is it something still under development?
Payload (removed all the irrelevant garbage)
{
"t":"GUILD_CREATE",
"s":7,
"op":0,
"d":{
"guild_hashes":{
"version":1,
"roles":{
"omitted":false,
"hash":"/OxAoU9j1Kc"
},
"metadata":{
"omitted":false,
"hash":"WSd1cVYInHI"...
Is there any guaranteed way to get when an Emote becomes (un)available?
Since this might be useful for bots who perhaps use emotes from a boosted Discord would it be good to have a reliable way of knowing when a specific (set of) Emotes becomes unavailable.
Olá! Bom, eu não sei se é aqui, mas, tudo bem
toda vez que reinicio o site (discord.gg/developer/applications) o token muda, isso é normal?
google translate
Hello! Well, I don't know if it's here, but, okay every time I restart the site (discord.gg/developer/applications) the token changes, is this normal?
Yes, it's normal
haha, then, in this case, the bot does not start, what can I do?
Take a look at this image for reference. google translate:Dê uma olhada nesta imagem para referência

google translated
Blue/azul : ID do usuário
Green/verde : registro de data e hora quando o token foi gerado
Red/Vermelha/Vermelho : HMAC, componente criptográfico para autorização real. Não é útil por si só.
@renato425 it depends on the error you are getting from Discord or your library.
| COMMUNITY | guild can enable welcome screen and discovery, and receive community updates |
I was thinking of that as in "the guild receives community updates" since it's required for community guilds
I am also seeing this same thing, somehow Spotify is doing it.
paste this link into a discord channel.
Spotify has a custom integration by Discord
I don't understand, does it depend on the bookstore I work in?
I usually do my bot's on discord.js
After translating the image, I saw that it is normal to change the token with each restart of the XD page
but even so, I can't get the bot online ... what can I do?
Can the thing on L19 be made clear for people that are U18?
Can the thing on L19 of legal terms be made clear for people that are U18?
I'm pretty sure it's dependant on which country you're in.
I'm pretty sure it's dependant on which country you're in.
Unless someone can correct me I think it's still under US State Law unless someone can correct
What line in particular is the one in question?
Unless someone can correct me I think it's still under US State Law unless someone can correct
Doesn't matter. Discord can be considered a multi-national company as they provide their services towards several countries and not every country treats the legal age of maturity the same way.
In some countries are you considered an adult with 16 in others with 20 or even older.
Discord's ToS does - as far as I'm aware - decide in which country their jurisdiction would be, which is the USA (F...
What line in particular is the one in question?
L19, I mentioned that in my original comment
what is the error? saying the bot can't go online gives too little info.
corrected documentation stating endpoint is only valid for public guilds as opposed to discoverable guilds, clarifed the Authorization header must be present, added example response.
Regrettably, the vanity invite for the Discord API server has been changed from discord-api to api. This PR updates the link in the official docs. To any readers, please spread the word and update your links in any third-party resources.
hmmmm .. it might be time to actually have the docs link our official developers server instead, and instead link API as a support resource on the libraries page (or have per-library support links)
The neither the Intro page nor the classic API docs link to any support server. There is a link to "Discord API" on the Community Resources page, and on this repo's readme, while "Discord Developers" is linked on top of all SDK and Dispatch pages. If you want to fix that up, go ahead, but my goal here is to just make the current links accurate.
We could add per-library links to the community page, although not every library has its own support server.
Can the thing on L19 of legal terms be made clear for people that are U18?
L19 says you need to be of legal age to form a binding contract. L139 says the laws of California, USA apply. If you are under 18, then you need your parent or guardian to get involved on your behalf.
Doesn't matter. Discord can be considered a multi-national company as they provide their services towards several countries and not every country treats the legal age of maturity the same way.
In some count...
Either ways, this is the wrong place to ask such questions.
You might consider asking this question at discord.gg/api. And consider closing this issue as well.
When you would ask this question again there, make sure to provide the error.
- it can also be accessed for all guilds the bot is in, and was already updated in #1763
- the authorization header is implied as it's required for all endpoints
- the example is where it should be: https://discord.com/developers/docs/resources/guild#guild-preview-object-example-guild-preview
Looks like there was a link to DAPI in the homepage but it was moved to community resources in 3f48e7183ba6685609856b088860ee38a3e49302.
imo:
- update readme to link to devs server
- add link to devs server in homepage
- fix link to API server in community resources
- add per-lib links to community resources (to its support server if available, or to its dapi channel)
The vanity URL has been reverted back to discord-api. Closing this as the changes are no longer accurate.
If you are under 18, then you need your parent or guardian to get involved on your behalf.
Realise that, just don't think many others will, I was confused at first as well until I saw Kadybat's message clarifying it (that was after a number of requests from other people as well)
Not asking for much, maybe just an extra sentence like "If you are U18, your legal guardian may accept the terms on behalf of you" or something.
oh, and if it wasn't clear either, I'm also NAL :)
I would like to add my library to the community resources list. Here's my rate limiting code: HandleRateLimits, and WaitForRateLimits. If you need links to any other code, just ask and I can give it to you.
Hello, i have create a discord bot, the first day perfectly work and the next day, unable to connect the bot (in private/public is same)
and if i just put a const discord.js + the token, it does not start either (it's been 2 times that happens to me)
it looks like the bot is banned ?
https://cdn.discordapp.com/attachments/320610774407970816/730687126651404309/Screenshot_20200709-091025_Chrome.jpg
i precise it's a reaction role bot
If your bot was banned you would get notified by e-mail, as well as a system message inside of Discord, so check if you have a new e-mail in your inbox or a new System DM inside of Discord.
no, you don't get notified
but @BlizZarOfficiel you need to say the client id for them to check
If your bot was banned you would get notified by e-mail, as well as a system message inside of Discord, so check if you have a new e-mail in your inbox or a new System DM inside of Discord.
Maybe temporary ban because my bot crashes and reconnect 50 time
what happens if you GET /gateway/bot with the bot's token?
but @BlizZarOfficiel you need to say the client id for them to check
Id : 730388800983007243
Maybe it helps, but if it is a reaction role bot, it may need to track users and by this you need to take intents into account and have to manually set the right to track users in your bot configuration.
what happens if you GET /gateway/bot with the bot's token?
https://zupimages.net/up/20/28/v73n.png : bug
https://zupimages.net/up/20/28/ae6s.png : work with other bot
that isn't GETting /gateway/bot
This can now be detected with role.tags
default avatars are currently static size and format on our cdn. we might revisit this in the future if we update those assets
decode error can only occur if your payload is malformed in some way.
this could be because you sent us compressed data, too much data, or a malformed message.
this is indeed working as intended. we can probably clarify this in the docs.
closing this due to lack of activity
If 730388800983007243 is your bot, then it is not banned.
Deprecated endpoints are not documented. You should only use what is documented.
We are moving towards a world where bots should not be syncing the entire state of the world. I would recommend refactoring your bot to function in an eventually consistent manner that does not require a full member list on start. While we have no plans current plans to remove the ability to sync the member list with intents, it will get harder to maintain that state at scale and it may eventually be removed from gateway since our clients do not use it in normal operations.
We do not currently support OpenGraph audio tags.
this will be fixed in the next deploy
duplicate of #1361
I guess it is the same issue, but in my examples there are no invalid keys set.
26a5792 update UpdateLobby callback in examples - night
I apologise for not updating this. I assumed the OP was taking care of it.
In order to help anyone else who may have this problem in the future, the issue was a traffic filter placed in front of our website by our host. This did not have the necessary permissions to fetch the page preview.
Our host was able to get this in place for us, and everything seems to be working great. Thank you all for your assistance, and I'm sorry it's taken so long for us to reply!
Aza (and @foresta86 )
We are moving towards a world where bots should not be syncing the entire state of the world.
In that case, I think its time to implements #448
Looks as if this has been implemented per https://github.com/discord/discord-api-docs/issues/1537#issuecomment-656308581.
// ... role instance
"tags": {
"premium_subscriber": null
}
For anyone interested, these are the tags I've found:
| Tag | Value |
|---|---|
| bot | the bot id |
| premium_subscriber | this is the nitro role, always null |
| integration | integration role, for example the subscriber role for twitch |
All these tags are only present for managed roles for their specific context. Only the nitro role will have a premium_subscriber tag and only a bot role will have the bot tag, etc.
Example:
{
"id": "289361194056155136",
...
Lack of activity? I provided you with the information you asked for.
You can do a hacky fix to do this by applying an "empty field" after the second and (optionally) the fourth entry (to align the four fields vertically).
{
name: '\u200B',
value: '\u200B',
inline: true
}
Unfortunately the empty spaces might shrink stuff, but if you have small titles/values it shouldn't be much of an issue.
I would be more than happy to not cache the full member list @night. The issue is, I need to know which members have admin perms OR a particular role, which oAuth does not expose currently. If #1612 was implemented, I would be able to use that instead, greatly reducing the amount of members needed in cache, and meaning that I don't need to request the entire list from Discord, as I understand that is a very taxing operation for you, particularly on large servers.
Any reason why premium_subscriber is always null and not, say, true? I mean we can manually convert it to true on the library side, but I'm just curious 😅
Any reason why
premium_subscriberis alwaysnulland not, say,true? I mean we can manually convert it to true on the library side, but I'm just curious 😅
maybe @night can give more context about this?
When I open up a user’s profile discord says there was an unexpected crash and tells me to reload

This repo is for issues regarding the Discord API. The correct place for this is the Discord Testers server.
By the way, here's the Trello thread about this issue.
We are moving towards a world where bots should not be syncing the entire state of the world. I would recommend refactoring your bot to function in an eventually consistent manner that does not require a full member list on start. While we have no plans current plans to remove the ability to sync the member list with intents, it will get harder to maintain that state at scale and it may eventually be removed from gateway since our clients do not use it in normal operations.
Any updates o...
🤔 All night said is that the bot shouldn't need the whole member list cached, not that bots can't have access to the info; can't you just fetch the member if they aren't already cached?
All night said is that the bot shouldn't need the whole member list cached, not that bots can't have access to the info; can't you just fetch the member if they aren't already cached?
Not at any reasonable scale. In a raid scenario on just a single server, I'd need to be checking for each users in a series of messages. Fetching a user is extremely limited. In one server I run a bot for this has outpaced 100 users per minute in a real scenario. But feel free to make some requests and watc...
If I have a moderation bot that should allow mods to clean up raids, I need to know various things about multiple message authors, such as if they have a trusted role and how recently they joined the server. If you'd prefer my bot to not have access to that knowledge, then I need a way to tell discord "delete these messages, but only if the author doesn't have any of these roles, and the person I'm deleting on behalf of does have a specific role or permission"
Isn't the member sent whe...
Oh yeah I forgot about that, that's true so it shouldn't be an issue
** The member object exists in MESSAGE_CREATE and MESSAGE_UPDATE events from text-based guild channels. This allows bots to obtain real-time member data without requiring bots to store member state in memory.
The example there was somewhat trivial, but there are other examples that would not be. Discord also does not send up to date member info when fetching a message, only on message creation, which means this can't be used on any messages which age out of the cache safely, and an indefinite cache would scale worse than just having all the member info and getting updates about it.
A non-trivial example:
a command which checks for inactive users who have joined within the last week (inactivity defined by lack of events seen in the guild), but only if they don't already have a role for being a verfied member of the gaming group, then provides a list so that the moderator running it can reach out to get info or remove them.
A command like this is currently possible, but would fail for any users which the bot hasn't seen since connecting in a situation without inform...
All night said is that the bot shouldn't need the whole member list cached, not that bots can't have access to the info; can't you just fetch the member if they aren't already cached?
Ah yes sure. I'll just make a fetch request for every single guild my bot is in to check that the member is there. Can't see any problems with that(!)
As #1776 points out there is a lock_permissions field when setting channel positions. As a quality of life feature this would be nice to have for the Modify Channel endpoint.
It already has parent_id, allowing setting a new parent, allowing it to lock permissions to it seems to be quite a natural expansion.
_Sidenote: yes, i am aware that we can pass the parents overwrites in order to lock, this is not the point...
Is it required? The endpoint returns sharding recommendations and a url which I assume is static.
Thanks in advance.
It's not strictly required if you already know the gateway URL and how you want to shard
however, note that the gateway ws url can theoretically change at any time and it would not be considered breaking because you shouldn't be relying on it not changing
This is what Jake said in the Discord API server

Which probably means, you can just hardcode the URL. And if you for whatever reason can't connect to it (they changed the URL or whatever) then fallback to requesting it from this endpoint.
As mentioned, this is not a bug. The sorting behavior is by position value, then a second sort is done by ID to resolve competing positions. Positions can have any value - they do not have to be unique, or contiguous. This applies to both role and channel positions. The correct means of sorting roles and channels is to use the associated endpoints to assert all role or channel positions at once. __For channel positions, you only need to assert positions within a category, or the top level._...
@almostSouji What I meant was only some advice - in order for channel positions to sort as you proabably expect, you need to use the bulk-set endpoint and set them all with sequential positions, as that is the easiest approach guaranteed to work as expected, without attempting to compute some "partial" sorting. You can of course set them to such arbitrary sequences, and can expect to see them as such in the wild.
@z64 Thank you for the clarification! We indeed noticed this to be the case after a bug arose and since have discovered #1776 and wish for #1796 which (along with proper documentation of sorting best practices) will make the task of properly sorting channels without messing up the underlying position data much more approachable!
@MinnDevelopment the bot role tag seems to be bot_id (now), i can not test integrations
Any reason why
premium_subscriberis alwaysnulland not, say,true? I mean we can manually convert it to true on the library side, but I'm just curious 😅
Guess: Because it can't associate an application (or bot) id with it and to keep type consistency, only other value in mind would be the guild or role id itself.
@acw0 @advaith1 @Taarek Thanks for the clarification. Would be nice if this is documented.
I think this is adequately documented.
Get Gateway
Returns an object with a single valid WSS URL, which the client can use for Connecting. Clients should cache this value and only call this endpoint to retrieve a new URL if they are unable to properly establish a connection using the cached version of the URL.
Check for a new URL if your cached URL does not work.
Get Gateway Bot
Returns an object based on the information in Get Gateway, plus additional metadata that can help du...
@SinisterRectus The endpoints are documented, yes, but what I meant was a tiny explanation why you should call /gateway/bot before establishing a WS connection...
Oh yes, thanks. I was puzzled by the fact that I need to make a request to /gateway/bot just to retrieve a url which i believe is static (or rarely changed by discord)
hello,
we are found a bug in discord
if you want see it come in the voice channel
and this bug you want to fix it because member exploit it for spy
if you want to see it call me
my id : 673227161439567887
and think you Discord Support .
If you found a security exploit you should contact discord with https://dis.gd/security
Yeah, if bot itself has view audit log perm, the WS can send to bot the payload with the user object that deleted the message.
@night #663 is locked, hence this issue opened by @Nexuist
Bots should have custom status, I don't see a reason for not letting bots set a custom status when they can set a presence.
planned, #1160 (but imo that issue should be reopened until it's added)
planned, #1160 (but imo that issue should be reopened until it's added)
Weird eh
Personally, I wouldn't be a fan of seeing "Maintenance" or "Outage" tags like those in your art, not to mention they'd sort of be pointless, given if your bot is offline, your users likely won't see it anyway. I feel there are better ways of communicating maintenance and outages to your end users (i.e. server announcements, news channel, website, bot status). Once bots are able to set a custom status (which is in the queue according to #1160), that would be a great way for bots to communicate...
custom status isn't shown when the user is offline though
custom status isn't shown when the user is offline though
True, you couldn't communicate an outage that way (there are other (and better, in my opinion) ways to do that), but you could communicate planned maintenance or information about an outage that took place.
If your bot is offline, that in itself communicates an outage. There's not really a nice way to communicate why the outage has taken place in the client when the bot is offline. I also don't think a tag is going to reduce co...
as of today (2020/07/13) the API does not send this in the initial role payloads, meaning you will have to request /guild/:id/roles once in order to receive this data.
I was told that this feature is only partially deployed. It most likely will take until the next guild deploy before it usable completely.
i would like to see that added too
I feel there are better ways of communicating maintenance and outages to your end users (i.e. server announcements, news channel, website, bot status). Once bots are able to set a custom status (which is in the queue according to #1160), that would be a great way for bots to communicate things like this.
I think that if users could click the tag, it could display a small text explanation reassuring and/or informing users about what's going on (defined by the administrators of the bot).
...
The reason for this is to prevent clients from sending multiple identification requests to Discord, which could hit the daily limit. It is also clearer when the promise for the connect method rejects (instead of hitting the gateway indefinitely).
Or, is it safe to trust Discord not to send multiple reconnect events as well as acknowledging heartbeats properly? I'm not questioning the API, I know it's awesome, I'm just not certain about how other people go about it.
There is a limit of 1 identify per 5 seconds. What are you talking about here?
Oh, you're talking about the initial wss connection? That would be more restrictive than just the identify limit because the connection count is almost surely going to be greater than your identify count, and it would have to be done by something like IP, since there is no authentication in that step.
@SinisterRectus Let me reword the question. After Discord has requested a reconnection, can I be sure that there's no reconnection right after that? (one after a while is okay, but not right after)
Discord also requires a reconnection if a heartbeat is not acknowledged. Can i be sure that after reconnecting my heartbeat will be acknowledged?
Strictly speaking, no, you cannot guarantee that you will not receive a reconnect event at any time, but why should that matter? If you receive a reconnect event, just reconnect and resume (or identify if necessary). The events are dispatched by Discord in a way that prevents every client from reconnecting at the same time.
clearer when the promise for the connect method rejects
this sounds like you are using a library as there is no thing in the api, you want to check the docs for the library you use and/or ask the people who made that
@SinisterRectus @AEnterprise I'm having a promise that resolves when Discord sends back a Ready event. I'm not sure whether to reject on the first reconnection or wait until all reconnections have finished. I don't know about Discord internals, but I'd assume there must be something wrong to issue a reconnect event, and if it happens again, my promise may never resolve or reject...
that def is a library doing that so you need to talk to them for how their implementation details work.
and getting a reconnect event is normal, discord sends them out regularly. i've never seen a reconnect just after a ready or while resuming tough
@AEnterprise No, I'm writing my own connection promise, so I can await the ready event
I think there are a few points you need to consider:
-
You should have a backoff on identifies that is ignorant to where the identify is coming from, whether it is in response to a reconnect or a clean session, or otherwise. Every identify originating from your application on the same token should wait 5 seconds after receiving READY (unless you have a large bot with a special concurrency value).
-
You should attempt to resume a session whenever possible (see the docs about this). Resum...
@SinisterRectus Your second point is very helpful. Thanks a lot for you time.
@AEnterprise Thank you for your input.
@m-Phoenix852 @KNzoYT I second that
I'm having an issue with my first discord bot. I've been following a guide(https://realpython.com/how-to-make-a-discord-bot-python/) on how to make a Python discord bot and have done all the steps leading to the running the actual bot(bot.py), the client, for the first time passing along the .env from another file.. bot.py and .env are both in the same directory but for some reason, I receive this error as follows:
Traceback (most recent call last):
File "C:\Users\Danny\AppData\Local\Pro...
Your token is incorrect.
In the future, please do not submit help requests here.
Instead, use the discord.py channel in the discord-api guild, or the help channels in the discord.py guild.
Your token is incorrect.
In the future, please do not submit help requests here.
Instead, use the discord.py channel in the discord-api guild, or the help channels in the discord.py guild.
Thank you, and I'll head that way then as I'm still having the issue. Appreciate the quick response.
Hi.
I have just been made aware of the upcoming age requirement to utilize your API.
I understand if you’re under 18 you can just get a parent to agree to the API TOS on your behalf, though such case is not simple.
For those who cannot get their parents or guardian to do such thing for them, you ruined their hobbies. Even for the ones who worked hard and spent time working on their bots to get verified, you made it useless. You wasted their time. You ruined their hobbies. You wasted ...
NOTE im not a lawyer. I am just expressing my opinion in this post.
There are plenty of legal reasons why you need to be of a certain age to use the service. The main reasoning I can think on the top of my head is legal accountability. As someone with access to the API, you are dealing with user data which is heavily protected under certain laws in Europe, and many other countries have other similar laws.
If you were to do something illegal or negligent with the data, Discord ...
It is worth noting that, according to current and previous Discord general ToS, (quote) if you are between 13 (or the minimum age of digital consent, as applicable) and the age of majority in your jurisdiction, that your legal guardian has reviewed and agrees to these Terms.
This is not new. I am not sure if specifically the age requirement for using the API is new, but this is not overall a major change in Discord's policies.
When discord issues an invalid session, is it required to close the connection and reconnect or I can just resume immediately?
Does the same apply to unacknowledged heartbeats?
I have been aware of the services literal ToS. Though, if they wanted to
age restrict things now, I believe 3 to 4 years after the bot api was
introduced, why not do it then?
On Tue, Jul 14, 2020 at 1:39 AM kittens notifications@github.com wrote:
It is worth noting that, according to current and previous Discord general
ToS, (quote) if you are between 13 (or the minimum age of digital
consent, as applicable) and the age of majority in your jurisdiction, that
your legal guardian ha...
For both of those events, you must close the websocket connection, yes.
They are not "age restricting things now". It's always been restricted. You've just been breaking tos until now.
The API was never restricted apart from the services Terms as per US law.
On Tue, Jul 14, 2020 at 1:42 AM Sharon Fox notifications@github.com wrote:
They are not "age restricting things now". It's always been restricted.
You've just been breaking tos until now.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/discord/discord-api-docs/issues/1804#issuecomment-657979204,
or unsubscribe
<https://g...
yeah, there's no age limit in the current dev tos, it was added in this update
I know... that’s why I made this issue.
Though nonetheless do I still uphold this.
On Tue, Jul 14, 2020 at 1:43 AM Advaith notifications@github.com wrote:
yeah, there's no age limit in the current dev tos
https://discord.com/developers/docs/legal, it was added in this update—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/discord/discord-api-docs/issues/1804#issuecomment-657979789,
or unsubsc...
Since 2015, if you are between 13 and the age of majority in your jurisdiction, that your legal guardian has reviewed and agrees to these Terms.
No, since the US Supreme Court passed the Children’s Online Privacy
Protection Act.
On Tue, Jul 14, 2020 at 1:47 AM Sharon Fox notifications@github.com wrote:
Since 2015, if you are between 13 and the age of majority in your
jurisdiction, that your legal guardian has reviewed and agrees to these
Terms.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/discord/discord-api-docs/issues/1804#issuecomme...
My comment was just about the dev tos; that's in the standard tos and doesn't specifically say that a parent has to read the dev tos
COPPA is for children under the age of 13. If you are between 13 and 18, you need a parent's permission to agree to Discord's TOS. It has been that way since the beginning. If you are under 18 and never got parental/guardian approval you have been breaking TOS. This is not a new clause.
Never said I never got parental permission to utilize the service, nor did
I disclose my age
On Tue, Jul 14, 2020 at 1:49 AM Sharon Fox notifications@github.com wrote:
COPPA is for children under the age of 13. If you are between 13 and 18,
you need a parent's permission to agree to Discord's TOS. It has been that
way since the beginning. If you are under 18 and never got
parental/guardian approval you have been breaking TOS. This is not a new
clause.—
You are receiving t...
The point is the age restriction you are quoting has existed already. You need to be 18 or get parental/guardian consent and have all this time. Nothing is different with the new TOS in that regard.
Never said I never got parental permission to utilize the service, nor did I disclose my age
…
On Tue, Jul 14, 2020 at 1:49 AM Sharon Fox @.***> wrote: COPPA is for children under the age of 13. If you are between 13 and 18, you need a parent's permission to agree to Discord's TOS. It has been that way since the beginning. If you are under 18 and never got parental/guardian approval you have been breaking TOS. This is not a new clause. — You are receiving this because you a...
Shrugs. To each their own
On Tue, Jul 14, 2020 at 1:52 AM Lachee notifications@github.com wrote:
Never said I never got parental permission to utilize the service, nor did
I disclose my age
… <#m_2391687918191666509_>
On Tue, Jul 14, 2020 at 1:49 AM Sharon Fox @.***> wrote: COPPA is for
children under the age of 13. If you are between 13 and 18, you need a
parent's permission to agree to Discord's TOS. It has been that way since
the beginning. If you are under 18 and neve...
You won't actually be prevented from using discord or the api by breaking the TOS. You may on the other hand get your account banned. As @Lachee said discord has that in their TOS to prevent discord from getting faulted in EU for something a kid did and also the COPPA act thing. If you want to listen to the rules you may want to get of discord until your at the legal age or you can go living on the edge and maybe get your account suspended by breaking the TOS. I don't think discord want to ex...
@acw0 What should be the closing code? I'm using 4009 for heartbeats and 4000 for requested reconnection, but not sure for invalid sessions
I'm told there's no specific close code required for this. Use whatever is most useful to you~
Nah, it's stupid to say to people "you're stupid for not breaking the law". And I personnaly don't see why your parents will disagree to let you code with Discord's API.
I am not a lawyer, but as far as I'm aware, you are still legally considered a minor under US law until the age of 18. Minors are not allowed to sign a contract on their own, and must get a parent or guardian to sign it for them in order for it to be a valid contract.
Unfortunately, I believe a Terms of Service agreement (whether regarding the service as a whole, or just a developer API) counts as a contract, and thus Discord is legally not able to allow you to sign your own contract u...
Every time I have to retry regenerate token and I put it in the code the error is the same.
Error:
Error [TOKEN_INVALID]: An invalid token was provided.
Script:
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`${client.user.tag} On-Line!`);
});
client.login("TOKEN");
...
Replace "TOKEN" with your Discord bot token.
Replace "TOKEN" with your Discord bot token.
I put "TOKEN" for indicate the positition of TOKEN, i know were is write "TOKEN" i must put my TOKEN
Make sure you use the client token, not secret. The latter is on the main page of your bot app, the former under the bot tab.
If you're still encountering issues, join the discord.js support server (link available on https://discord.js.org/#/docs/main/stable/general/welcome) and ask in one of the support channels 👍
Make sure you use the client token, not secret. The latter is on the main page of your bot app, the former under the bot tab.
If you're still encountering issues, join the discord.js support server (link available on https://discord.js.org/#/docs/main/stable/general/welcome) and ask in one of the support channels 👍
Also, your versions don't corelate at all. Screenshot shows you're using d.js v11, not v12, as ClientManager or WebSocketConnections don't exist in v12 (WebSocketCo...
I recommend joining the discord.js support server (link over at https://discord.js.org/#/docs/main/stable/general/welcome) and asking there, or if you'd want, you can DM me on Discord (Vladdy#0002) and we'll get it figured out 👍
I recommend joining the discord.js support server (link over at https://discord.js.org/#/docs/main/stable/general/welcome) and asking there, or if you'd want, you can DM me on Discord (Vladdy#0002) and we'll get it figured out 👍
However, it (most likely) isn't a Discord API issue, so you can also probably close this issue 😅
Thanks for the support. Anyways, I'll leave the issue open, hoping for a solution.
You'll most likely not get a reply here. This is a repo for Discord's API, and it's not an API issue. You'd be better off by either asking in the library's support server and/or opening an issue in the library's repo.
Up to you, but staff will most likely close it if you don't 😝
You'll most likely not get a reply here. This is a repo for Discord's API, and it's not an API issue. You'd be better off by either asking in the library's support server and/or opening an issue in the library's repo.
Up to you, but staff will most likely close it if you don't 😝
I think is a Discord API error, not a error caused by library, because this error goes out whit every TOKEN generate by my discord developer portal.
Have you tried sending a request manually (using cURL, for example)?
If you wanna verify if it's discord.js or a Discord API issue, run this simple command in your command prompt (replace NDY3NjU1ODczMjY3NzYxMTUy.Xw27uQ.YOUR ACTUAL TOKEN GOES HERE with the token from the dev portal, keep the Bot prefix (d.js adds it btw))
powershell iwr https://discord.com/api/v7/gateway/bot -Headers @{'Authorization' = 'Bot NDY3NjU1ODczMjY3NzYxMTUy.Xw27uQ.YOUR ACTUAL TOKEN GOES HERE'} -UserAgent "DiscordBot"
If you get a reply like this
StatusCode ...
How to accept an invite?
The user you invite will receive an email where they can accept the team invitation.
I am not a lawyer, but as far as I'm aware, you are still legally considered a minor under US law until the age of 18. Minors are not allowed to sign a contract on their own, and must get a parent or guardian to sign it for them in order for it to be a valid contract.
Also not a lawyer, but in most states minors can sign contracts, they can just void them whenever they want (except for essentials like food, clothing, shelter, etc.) The TOS just has the parental consent part as a protecti...
@webhp Huh. I hadn't actually looked up the law in a while, and I should of done so before posting my comment. So thank you for correcting me.
Truthfully, this seems like the fundamentals of coding a discord bot may not be there. I have went through https://discord.js.org and followed the example, which is similar to what you have. And it works fine.
You have to make sure in your bot portal that you are using your bot token and not your token.
Under our API Terms of Service, if you are under the age of consent to sign a contract, we ask that you have a parent or guardian review and agree to our API terms on your behalf before you begin to use or resume further use of our developer tools and API.
If you have further questions about this policy or its changes, please reach out to our support team and we'd be happy to answer any followup questions or concerns: https://dis.gd/contact
If your session became invalid a reconnect is not actually required unless your connection was also closed by us. You can send an Identify opcode or a Resume opcode if the session is resumable.
For unacknowledged heartbeats that's ultimately up to you. If your connection is split it will eventually timeout, but you can time it out sooner if a heartbeat goes unacknowledged.
@vladfrangu I tried to use the code suggested by you, here is the result:
(the green line is my TOKEN from developer portal)
What is your application's id?
@night
ID: 584063287428251661
You emailed our support and said your bot token was compromised, so we disabled your bot's token. I have followed up on your support ticket directly.
@night How can enable it again?
@night Thak you for the support,I just read your reply on the tiket. I'm heppy!
@night Thanks for the explanation
how do i make my bot online and start making the commands for my bot
i cant find where i can start making my commands anywhere nor edit anything and no one can join my group oe help me with my bot.
To make a bot, you need to first learn a programming language, and then pick a discord API library for that language: https://discord.com/developers/docs/topics/community-resources#libraries
Hey, so I'm one of those guys who is super paranoid of accidentally violating TOS and hitting the rate limit too often. It's kind of unclear in the documentation if the X-RateLimit-Bucket is only passed when one is rate limited, and if so what, or if you can pass a header to make it respond with the Rate Limit values along with the intended result.
Maybe I just don't know exactly how to do it myself but I cannot seem to figure out even a CURL command to respond with the headers. If there i...
You should get the X-RateLimit headers on all requests, however, it's recommended to use a library and it will handle ratelimiting for you.
I believed it should too, but using this example real fast shows no X-RateLimit, unless im missing something else 😅
>>> x =requests.get("https://discord.com/api/v6/guilds/515537853711646731", headers={"Authorization": "Bot Very_real_bot_token"})
>>> pprint(x.headers)
{'Date': 'Wed, 15 Jul 2020 04:34:59 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Set-Cookie': '__cfduid= expires=Fri, 14-Aug-20 04:34:59 GMT; path=/; domain=.di...
Many GET routes do not have rate limits and will not have a x- rate limit header unless you hit the global rate limit. There is no indicator to know if you are approaching the global rate limit, you'll only know once you've hit it.
Many GET routes do not have *bucket rate limits and will not have a
x-rate limit headers unless you hit the global rate limit. There is no indicator to know if you are approaching the global rate limit, you'll only know once you've hit it.
Hm. that is useful to know, kind of tricky to get around, since I've used the method of waiting so many seconds between requests and trying to not hit the rate limit. since it's harder to handle hitting it than it is to avoid hitting it. Maybe some c...
Every time i close and open discord on android, a message appear

and i can't close without clicking in ok that goes directly for the message.
Hi. This repository is for support with the Discord API. General help requests should be sent to Discord Support.
To answer your question, if you mark the urgent message as read, this should stop happening.
AFAIK, everything that requires your bot token to authenticate contributes towards your global rate limit which, right now defaults to 50 requests per second. You can use this knowledge to hard-code your own rate limit or just opt to handle the rate limit when you encounter it. Either way it's the same, you throttle your requests and handle the throttled ones however you please.
Note that it's expected to hit rate limits on occasion, especially in cases of rate limits that are shared acr...
[@IdioticProphet] Thank you for your response! Feel free to close for me if you can, if not I can
We can't close the issue -- the only ones that can are you, or someone marked as a member of the Discord organization. If you want to close it, there's a "Close Issue" button just below the comment box, right next to the "Comment" button.
[@mr-tech] You can use this knowledge to hard-code your own rate limit or just opt to handle the rate limit when you encounter it.
From the [Ra...
I said that full well knowing what the docs recommend and with it in mind that the docs are not the be-all and end-all. Yes, if you get rate limited, no matter what else you are do you need to handle the rate limit accordingly and continuing to spam the exact same request before the retry-after* is up is not that. Why retry-after? Because as with case of undocumented "sublimist" such as channel name / topic, the regular X-headers are misleading while the retry-after in the headers and `...
Hallo,
i am implementing Userauth on a GTA5 RP Server (alt:v) using Discords OAuth2. I added an Application an generated a OAuth2-Url (https://discord.com/api/oauth2/authorize?client_id=732648978163957770&redirect_uri=http%3A%2F%2Fresource%2Fclient%2Fhtml%2Fstart%2Findex.html&response_type=code&scope=identify)
the redirect url is: http://resource/client/html/start/index.html (its a local website)
so far so good...
if i log in i got redirected with "invalid_grant" but i would expect somt...
invalid_grant is generally an error you get when you try to do the token exchange call -- that is, after the redirect has already worked correctly.
The most common reason to get the invalid_grant error is that you're not serializing the body of the token exchange request correctly as application/x-www-form-urlencoded. (Note that the documentation contains a code snippet that simply sets the content-type to this value and then depends on the HTTP library in use to make sure that w...
thanks for your reply but it does not match my tests on that issue... i tested it with an real website (my private one) as redirect url and it worked... (https://www.myprivatesite.com/about?code=authtokenhere) if in the same setup just with a different url
i am confused!
@AndreasHeine Did you check alt:V discord? I think Stuyk wrote something about it.
yes he did but its depricated... i asked him already...
Can you give more detail about how you observe the invalid_grant error? Log snippets, screenshots? I have never heard about that code arising before you get the redirect and try to exchange for a token.
you could try it yourself the link is still aktive: https://discord.com/api/oauth2/authorize?client_id=732648978163957770&redirect_uri=http%3A%2F%2Fresource%2Fclient%2Fhtml%2Fstart%2Findex.html&response_type=code&scope=identify
the weird thing is down below...
Hmm, I stand corrected. I suspect the cut-off path is a deliberate effort just to show the hostname part of the URL, but why you get invalid_grant at that point beats me. You have whitelisted your alternative redirect URI (the whole thing, including everything in it) in the developer portal, right?
maybe this will help you
https://github.com/discord/discord-api-docs/issues/1296#issuecomment-599617665
Also there is this if you want to take a look at it
https://github.com/hicham4i/altv-discord-OAuth2-connector/
@Zerefdev, that was my assmumption too, but the screenshots are not consistent with that hypothesis,
any other suggestions? i just want to get the discord username of a player to load the right charakter data nothing more...
It appears that Discord doesn't support redirecting to a local hostname without extra qualification; perhaps they try to hit the endpoint on their end if it's not obviously a local source like localhost or an IP in the private ranges; I'm not sure. Try redirecting to resource.local instead to force that local hostname lookup.
d016d8f 2020 Dev TOS Revisions - msciotti
Opening a PR for visibility
Thank you all for your feedback about the 2020 Dev TOS changes. We've taken what you've said into account, and after some internal review, have made a few changes
Changed "age to accept a contract" language in favor of standard TOS language
This language was confusing for lots of folks, as we don't in other places reference a "legal age to sign a binding contract". We've updated the language to reflect the language in our standard user TOS, found ...
looks like you duplicated a space here
your relationship with us.. Yo
Iterating on this. You're going to run into various issues while using the http://resource/ part of alt:V. What you're likely going to want to do instead is spin up an express server with an exposed port to receive the re-route.
You're also going to need to create a token for the player and bind it to them and then append it to the Discord data as they go through the verification process through oAuth2. That way you are able to easily discover which token belongs to a user.
I do not ...
I believe you're missing a last point here - the sentence now ends with or.
Eu tenho um Samsung Galaxy A20s e as vezes quando muto consigo falar mesmo mutado, isso me atrapalha um pouco !
Hi, this repository is for assistance with the Discord API. For client issues, please join the Discord Testers server or contact support.
Olá, este repositório é para assistência com a API Discord. Para problemas do cliente, entre no Discord Testers server ou entre em contato com o suporte.
For information about bot verification, read the blog post, the support article, and #verification-faq in the Discord Developers server.
I have regenerated the token many times, but i still get an error saying that the token is invalid. I have tried with other applications and it worked, but i really need this one to work. My account recently got hacked and the person turned the bot into a mass dm bot. Just got my account back and im guessing its been banned for api abuse, if so please help to unban it. Thank you
The Bot id is 710906959934783560
The reason you should enable 2FA on your account, especially if you're a developer. Good luck in your bot journey :]
The reason you should enable 2FA on your account, especially if you're a developer. Good luck in your bot journey :]
I have 2FA on my account.
So in general, events can be dropped. If they're not entirely consistent, it could very well be latent production issues. A similar thing was reported in the partner server a couple weeks ago and night traced it back to a production issue.
It's unfortunately too late to look back at logs for this event now, but if this happens again, could you re-open this issue with the time of the event?
These bots were specifically made for the Rythm server, so yeah..
The most recent user it happened with is 536201391497281556. They were removed at 5.41 PM UTC yesterday.
Their username does not match any of the bot's local state.
The REST API returns it as 'Rythm'. But when they were removed their name was Flucksy.
Thanks for the reply, Mason.
I just discovered this testing a bot out, and I'm not sure why, but trying to delete a role on a larger guild (mine has 35,000+ members for example) makes this endpoint take 4-5 seconds or more to complete, even if the role has no members at all. Compared to a smaller guild where it takes 200ms or less. Is this a bug or a unfortunate side-effect of deleting roles for larger guilds? I assume it's just that no matter the number of members a role has it has to check EVERY member for the role or ...
I'm not sure if this is on purpose or not, but in the docs (https://discord.com/developers/docs/topics/gateway#activity-object-activity-types) the watching status does not appear.
It's intentional right now because users cannot set a watching status, so you shouldn't receive one from anyone.
My guess it's because GUILD_ROLE_DELETE needs to be dispatched to so many users, there is a short delay.
It's because we iterate over the entire member list to remove the role. It can't be made faster without making it async table scan.
Your bot was banned from our platform. You would need to reach out to our trust and safety team: https://dis.gd/contact
Alright, I just wasn't sure what the cause was. It'd be a nice room for a performance improvement since i'm sure it takes even longer in larger guilds than the ones I'm in.
I'm not entirely sure if this is possible, but it could be handy to delete the role first, and then remove it from the members afterwards. If possible, this could be used to prevent logging bots sending many messages along the lines of "Deleted role was removed from x". Currently the only method is to delay the log for a few seconds and see if the role has been deleted then - but the for large servers this clearly doesn't work because of the big delay.
I'm not entirely sure if this is possible, but it could be handy to delete the role first, and then remove it from the members afterwards. If possible, this could be used to prevent logging bots sending many messages along the lines of "Deleted role was removed from x". Currently the only method is to delay the log for a few seconds and see if the role has been deleted then - but the for large servers this clearly doesn't work because of the big delay.
The current order is better imo, it...
That's a good point. How about dispatching the role delete event in the gateway first, however?
That would cause certain problems in both Discord's side (event retention and delays, which increases memory usage) and clients (specially moderation bots) as they'll remove a role they cannot reference and will have no idea what role was deleted, requiring them to cache a deleted entry in memory temporarily and "watch for members to change", which is more troublesome than the current system.
This bug is:It happens randomly,so you need to reset sound and everything to desbug,so fix it.
Hello. This repository is for issues with the Discord API. For client issues, please join Discord Testers or contact support.
During an outage or maintenance, most of the bots are currently offline, so I don't see any point in this though.
The only thing I'd add to this is that Discord sharding allows you to do 0 downtime updates. So if your lib supports this you can basically deploy your entire bot update without rebooting at all.
You can establish multiple sessions with the same [shard_id, num_shards], or sessions with different num_shards values. This allows you to create sessions that will handle more or less traffic than others for more fine-tuned load balancing, or orchestrate "zero-downtime" scaling/updating by h...
PRESENCE_UPDATE is by far the most common gateway event for bots that cover a large userbase. Several orders of magnitude more than the others. If this is unused, it costs significant CPU usage on both ends of the connection. However the GUILD_PRESENCES intent also controls if presences = true is usable on REQUEST_GUILD_MEMBERS. It'd be useful to decouple these two in some way for bots that don't need constant presence updates for all users, but need presence information for targeted actio...
When scrolling on the server members list, two users names duplicate and cover the names of other users and then continue to multiply the more I scroll up and down. Attached is a video example of the issue.
https://share.icloud.com/photos/0UPYQ9TgxM7zd7cYjayohTvkQ#Oklahoma_City
Hi, this repository is for assistance with the Discord API. For client issues, please join the Discord Testers server or contact support.
Oftentimes, a link sent through a webhook message will not generate an embed,
If the same payload is re-sent later, without modifying any permissions or settings, an embed will be added to the webhook.
I have experienced this mostly with YouTube links, but it also happens with random websites or even Discord CDN image links.
Quite a few people have submitted bug reports to a couple bots I contribute to that make use of webhooks, so I'm assuming the issue is spread across Discord.
These b...
i experience RTC disconnected most of the time. its like and you are listning music and suddenly music stops and it says RTC disconnected.
i face it a lot of time. my internet connection is ok and not that bad.
Hi, this repository is for assistance with the Discord API. For client issues, please join the Discord Testers server or contact support.
As per your issue, voice server disconnections can be caused by many different factors, including server issues outside of your control. Try changing the voice region to something closer to you, or asking a server admin to do so.
Event | # Dispatched | # Run | Total Runtime | Average Time
========================+==============+==========+===============+=============
bulk_message_delete | 25 | 0 | 0 | N/A
command | 128 | 0 | 0 | N/A
command_completion | 118 | 0 | 0 | N/A
command_error | 9 | 18 | 0 | 0
...
Some users have private flags containing 1<11 which is currently undocumented. It would be nice to get clarification on what this flag identifies?
Only the public flags are documented, there are many other undocumented private flags (but iirc all of them are known except for the mysterious 1<<11)
Last time I checked, I couldn't find a useful reference to 1<<11 in the client. It may be worth checking again.
(node:5360) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
at WebSocketConnection.client.ws.connection.once.event (/rbd/pnpm-volume/2e1fadca-cf17-48a4-9f56-4855a04c9da6/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/ClientManager.js:48:41)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at WebSocketConnection.emit (events.js:211:7)
at WebSocketConnection.onClose (/rbd/pnpm...
ı test with other tokens its work but my token not works with this bot
Try making an another application and try then. As far as I know the Regenerate Token should work.
The problem is from the library you are using.
Bot Activity disappears
I don't think it is acceptable to have to refresh the activity on a regular basis, it should be that the bot will retain its activity setting it once (just like a custom status for users it will remain until changed)
This is an issue with the library or how discord operates with bots and should be changed
This is really needed. Especially now with all servers exposed and forced to have the feature. A server pruning 20k members would tax the bot let alone if its a lot more (which has been the case for me).
A Guild Members Prune event would be ideal and it would be less taxing for both Discord and the bots. No need to even send the Guild Member Remove events regarding these pruned members.
This isn’t a discord api bug, it’s an error with your library, which seems to be javascript. As with the token, try making another one and see, your bot might have been actioned on by tryst&safety.
I created a member counter bot, that will update member stats channel with the member count in my guild every 5mins.
In that 5mins, I updated 2 channels which the Member count and Bot count channel.
The code works perfectly fine for only that 5mins !
I also put a console.log("Trying to update channel name"); before sending the request to discord api and then after the request is success there was another console.log("Request Sent Yeppie");
My console :
`
Logged In as [REDACTED]
...
Perhaps a better alternative would be something like #1715, where a bulk guild member role remove event is sent. This could just be one single payload that includes all of the member ids where the roles were removed. This would be significantly lighter work on the gateway, as it would only send one event to each online member, instead of an event for every member that had their role removed.
In fact this could apply to more than just role removes. Anything where it affects multiple items:...
Updating a channel name and topic is limited to 2 updates per 10 minutes, per channel.
Hi thanks for the fast response, is there anyway to rise the limit for updating a channel name ?
Because my bots are now broken because the rate limits 😄 .
Also i recommended adding this to the docs, because many people searched this a lot on stack overflow.
The rate limits were added exactly for this reason, to counter against channel-counter bots, so no. You can't have it raised.
Also they don't document rate limits, since they are not static, they're dynamic.
See: https://discord.com/developers/docs/topics/rate-limits
This is quite annoying, Documentation says that 120 events per 1 mins right ?
This is only true for the gateway and not the REST API.
For the REST API rate limits, see https://discord.com/developers/docs/topics/rate-limits. There are headers returned in the response that indicates how many requests are left and after which time they reset.
If you update the channel name or topic too often at a certain time you may encounter a 429s:
{
"global": false,
"mess...
@Taarek Wait really? This new rate limit is or preventing counter bots ?
Damn, I still see server counter both like the one developed by Plexi Development are still working just fine.
Yes, they bot are already verified and used in more than 1000 servers.
Well if our bot is verified does it allow us to bypass the rate limit or the rate is fixed for any unverified and verified bots ?
@angelobreuer Great thanks for the example, that's is really make anything easier to me.
Next time i should tell my code to validate the response yeah ? lol.
My choice of just ignoring any response the API's sent back to my server is bad 🤣
What I have so far: It's an internal flag that in some way relates to the system for partner/verification applications. Not much else is known, including the name of the flag.
This is the wrong repo to make this issue on. I recommend closing this issue and reopening it in the github repo of your library, or asking in their community server.
This flag was mistakenly exposed to clients in private flags. It will be removed in the next deploy. No need to worry about it.
Well, it was a fun game of capture the flag for the short time it lasted. Can you make more of these mistakes often? :)
rate limits are the same for all bots and cannot be increased per-bot (except the global rate limit, but that isn't your issue); you shouldn't be constantly updating the channel name but if you do then discord recommends member count bots just update it once every 10 mins.
@advaith1 How about when the bot got like 10 servers ?
Can it update all server together in that 10mins ? or only 2 server can be updated at 10 mins ?




