Skip to content

Commit e209a4b

Browse files
Chore : Added a delay in mention-each command (#231) (#233)
Desc : As there is no other way to add a delay in callbacks provided to ctx.waitUntil, faking a promise is the only way left Co-authored-by: Amit Prakash <[email protected]>
1 parent 32c4fc0 commit e209a4b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/utils/guildRole.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export async function mentionEachUserInMessage({
157157
}) {
158158
const batchSize = 5;
159159
let waitTillNextAPICall = 0;
160+
await new Promise((resolve) => setTimeout(resolve, 1000));
160161
try {
161162
const failedUsers: Array<string> = [];
162163
for (let i = 0; i < userIds.length; i += batchSize) {

0 commit comments

Comments
 (0)