MCPcopy Index your code
hub / github.com/CopilotKit/OpenTag / getUpdates

Function getUpdates

e2e/telegram-api.ts:159–173  ·  view source on GitHub ↗
(
  offset: number,
  limit = 20,
)

Source from the content-addressed store, hash-verified

157 * Uses long-poll with a short timeout so we don't block indefinitely.
158 */
159export async function getUpdates(
160 offset: number,
161 limit = 20,
162): Promise<TelegramUpdate[]> {
163 return tgApi<TelegramUpdate[]>(BOT_TOKEN!, "getUpdates", {
164 offset,
165 limit,
166 timeout: 5,
167 // Include both new messages and edits so we can observe streamed replies.
168 // The example bot streams by posting a placeholder and then editing it
169 // (chunked-edit mode), so we must subscribe to edited_message to see the
170 // final text.
171 allowed_updates: ["message", "edited_message"],
172 });
173}
174
175/**
176 * Drain any pending updates from the bot's queue (advances the offset without

Callers 3

drainUpdatesFunction · 0.85
watchForReplyFunction · 0.85
watchForNextReplyFunction · 0.85

Calls 1

tgApiFunction · 0.85

Tested by

no test coverage detected