Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad Structures #51

Open
Darker-Ink opened this issue Aug 8, 2023 · 2 comments
Open

Bad Structures #51

Darker-Ink opened this issue Aug 8, 2023 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Darker-Ink
Copy link

A lot of the Structures (main ones I can see are the channel, and possibly guild?) are formatted as if it were a normal user / bot connecting to the gateway when this is not the case.

RPC returns a LOT less data than you might expect. For example

{
  id: '365498559174410241',
  name: 'The Gearbox',
  icon_url: 'https://cdn.discordapp.com/icons/365498559174410241/a_8b7ebc6c35b4830c9645a7dc5a18c498.webp?size=96'
}

This is the data returned for when you fetch guilds and

{ id: '1138499058495918140', name: 'channel-87', type: 0 }

this is what is returned when you fetch channels (from a certain guild)

How the structures are formatted do a terrible job at.. well being structures. For the guilds if you get the access token & the guilds scope you could just fetch from /users/@me/guilds which would return a lot more data which you could have functions in place to support that if the users choose to use those functions.

As well when you subscribe to a channel (with the code for example)

client.subscribe('MESSAGE_CREATE', {
        channel_id: '1138495293453774860'
});

it works fine and all but when you want to get said messages from like

client.on('MESSAGE_CREATE', (data) => {
// other code
})

the typings don't display MESSAGE_CREATE unless I'm doing it the wrong way

@Darker-Ink Darker-Ink added the bug Something isn't working label Aug 8, 2023
@xhayper
Copy link
Owner

xhayper commented Aug 8, 2023

I did a terrible job typing and documenting this library, thank you for the information and suggestion, i will get it fixed sooner or later

@xhayper
Copy link
Owner

xhayper commented Aug 10, 2023

I have go ahead and fix the client.on issue

@xhayper xhayper added the enhancement New feature or request label Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants