#github-notifications

1 messages · Page 20 of 1

chilly siloBOT
#

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...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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 ...

#

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...

chilly siloBOT
chilly siloBOT
#
z64

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...

chilly siloBOT
#

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.

chilly siloBOT
chilly siloBOT
#

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

chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
#

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.

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...
chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
#

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...
chilly siloBOT
#

@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...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

@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.

chilly siloBOT
#

@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...

chilly siloBOT
#

@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...

chilly siloBOT
#

@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-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 figur...

chilly siloBOT
chilly siloBOT
#

@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.

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

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.

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

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...

#

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...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

As the title says, in the gateway's documentation of the guild members chunk, the chunk_index's description has &lt; 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...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

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

image

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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,...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
#

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...

chilly siloBOT
#

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...

chilly siloBOT
#

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.

chilly siloBOT
#

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

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

@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...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

@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.
image
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 ...

#

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 ...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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..

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

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...
chilly siloBOT
#

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

chilly siloBOT
#

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...

chilly siloBOT
#

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
![Screenshot_20200608-224707_Video Player](https://user-images.githubusercontent.com/66654916/84099528-337fbf80-a9e0-...

chilly siloBOT
chilly siloBOT
#

you aren't removing the original reactions. just the ones that are added by users after the initial reactions

That is correct - the initial reactions from the bot are always present on the message.

When did this start happening?

The earliest date I've had reported to me is on May 26th, though that's just the earliest reported time for a relatively small bot of mine. I'd guess that the earliest time of this happening is the 24th, though my earliest confirmed time is the 26th.

chilly siloBOT
#

Any ideas on how to fix please?
Thanks for your help!

Scarica Outlook per iOShttps://aka.ms/o0ukef


Da: Zack notifications@github.com
Inviato: Tuesday, June 9, 2020 1:49:58 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)

Your host is returning us:

<html>
<head>
<met...

#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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'...
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
#

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...
chilly siloBOT
#

@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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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

chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
#

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...

chilly siloBOT
#

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

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

There's a couple issues we've found that attribute to this condition:

  1. reaction adds/removes can become inconsistent within our database during database availability issues
  2. 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.

chilly siloBOT
chilly siloBOT
#

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...
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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: '',
...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...
chilly siloBOT
#

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...
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

From the website

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...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
#

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?

chilly siloBOT
#

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.
...

chilly siloBOT
#

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...

chilly siloBOT
#

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.
Hanging Forever
It gets stuck like this ^^
![404 response](https://applebee1558.com/uploads/2020/06/firefox_IfCty...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#
z64

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...

chilly siloBOT
#

@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...

#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#
z64

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.

chilly siloBOT
#

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...

chilly siloBOT
#

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?

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

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 ...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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.

#

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 )

chilly siloBOT
chilly siloBOT
#

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",
...
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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?

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...

#

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...

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

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._...

#
z64

@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.

chilly siloBOT
#

@MinnDevelopment the bot role tag seems to be bot_id (now), i can not test integrations

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 😅

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.

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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

chilly siloBOT
#

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.

chilly siloBOT
#

@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...

#

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...

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

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.

#

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...

#

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...

#

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...

#

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...

#

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...

#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

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.
ErrorBot

Script:

const Discord = require('discord.js');

const client = new Discord.Client();

client.on('ready', () => {
    console.log(`${client.user.tag} On-Line!`);
});
client.login("TOKEN");

...

chilly siloBOT
#

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 👍

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.

chilly siloBOT
chilly siloBOT
#

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.

#

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 ...
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
#

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...
chilly siloBOT
#

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...

chilly siloBOT
#

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...

chilly siloBOT
#

[@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...

chilly siloBOT
#

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 `...

chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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 ...

chilly siloBOT
#

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 ...

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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?

chilly siloBOT
chilly siloBOT
#

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 ...

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
#

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...

chilly siloBOT
#

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.

chilly siloBOT
chilly siloBOT
chilly siloBOT
#

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...
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
#

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...

chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT
#

(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...

chilly siloBOT
chilly siloBOT
#

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.

chilly siloBOT
chilly siloBOT
#

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:...

chilly siloBOT
#

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...
chilly siloBOT
chilly siloBOT
chilly siloBOT
chilly siloBOT