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

Function sendMessageAsSenderBot

e2e/telegram-api.ts:138–151  ·  view source on GitHub ↗
(
  chatId: string | number,
  text: string,
  opts: { replyToMessageId?: number } = {},
)

Source from the content-addressed store, hash-verified

136 * user id, which doesn't make sense. Use group chats for automated mode.
137 */
138export async function sendMessageAsSenderBot(
139 chatId: string | number,
140 text: string,
141 opts: { replyToMessageId?: number } = {},
142): Promise<TelegramMessage> {
143 if (!SENDER_BOT_TOKEN) {
144 throw new Error(
145 "TELEGRAM_SENDER_BOT_TOKEN not set — automated send unavailable",
146 );
147 }
148 const params: Record<string, unknown> = { chat_id: chatId, text };
149 if (opts.replyToMessageId) params.reply_to_message_id = opts.replyToMessageId;
150 return tgApi<TelegramMessage>(SENDER_BOT_TOKEN, "sendMessage", params);
151}
152
153// ── Polling helpers ───────────────────────────────────────────────────────────
154

Callers 1

runCaseFunction · 0.85

Calls 1

tgApiFunction · 0.85

Tested by

no test coverage detected