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

This error occurs when the bot receives a lot of message. #10

Open
dongsu8142 opened this issue May 27, 2020 · 6 comments
Open

This error occurs when the bot receives a lot of message. #10

dongsu8142 opened this issue May 27, 2020 · 6 comments

Comments

@dongsu8142
Copy link

error: Uncaught TypeError: Cannot read property 'id' of undefined
let user: User = client.users.get(author.id);
^
at buildMessage (https://deno.land/x/katana/src/utils/resolvers.ts:252:44)
at TextChannel.send (https://deno.land/x/katana/src/models/channels/TextChannel.ts:57:20)

@stuyy
Copy link
Owner

stuyy commented May 27, 2020

Yup. It's because you're getting rate limited from the Gateway, so it sends a Payload with an error message. Will have to handle this and apply some sort of rate limit.

@dongsu8142
Copy link
Author

I hope this problem will be solved quickly and API will grow a lot.

@stuyy
Copy link
Owner

stuyy commented May 27, 2020

Yep, since the API allows 120 requests per 60 seconds, that means you can only send 2 events per second. So I might just add a setTimeout(). However, I may set up a PriorityQueue structure and use that to handle events to prevent rate limiting. Will have to experiment. Thank you for bringing this up.

@dongsu8142
Copy link
Author

I want you to fix the error quickly.

@ITS-NIGHTOWL
Copy link

Stuff like this takes time, give the man a break

@dongsu8142
Copy link
Author

dongsu8142 commented May 28, 2020

okay I'm sorry I rushed you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants