Skip to content

Commit

Permalink
chore: fix twoslash errors in rate-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed Apr 6, 2024
1 parent 462d2b0 commit 7777066
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/rate-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ import { Bot, TelegramError } from "gramio";
import { autoRetry } from "@gramio/auto-retry";

const bot = new Bot(process.env.TOKEN!).extend(autoRetry());
const chatIds = [
const chatIds: number[] = [
/** some chat ids */
];

for (const chatId of chatIds) {
const result = await bot.api.sendMessage({ suppress: true, chatId, text });
const result = await bot.api.sendMessage({
suppress: true,
chat_id: chatId,
text: "Hi!",
});

await scheduler.wait(
result instanceof TelegramError && result.payload?.retry_after
Expand Down

0 comments on commit 7777066

Please sign in to comment.