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

driver.sendDirectToUser ERROR too-many-requests #119

Open
MonsieurPatate opened this issue Oct 8, 2020 · 0 comments
Open

driver.sendDirectToUser ERROR too-many-requests #119

MonsieurPatate opened this issue Oct 8, 2020 · 0 comments

Comments

@MonsieurPatate
Copy link

I'm trying to send broadcast notification in direct message via bot (bot repository):

const { driver } = require('@rocket.chat/sdk');

module.exports = (robot) => {
    robot.respond(/notify/i, (msg) => {
        let userNames = ['1','2','3'];
        userNames.forEach(userName => driver.sendDirectToUser(message, userName));
    }
}

In the administration panel I turned off all rate limiters, but every time I get an exception :

ERROR [createDirectMessage] Error: {
isClientSafe: true,
error: 'too-many-requests',
reason: 'Error, too many requests. Please slow down. You must wait 54 seconds before trying again.',
details: { timeToReset: 53009 },
message: 'Error, too many requests. Please slow down. You must wait 54 seconds before trying again. [too-many-requests]',
errorType: 'Meteor.Error'
}

I have about 2000 users and I don't think that it should be a problem.

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

1 participant