diff --git a/packages/telegram-plugin/src/index.ts b/packages/telegram-plugin/src/index.ts index f1cc9df..64bdb65 100644 --- a/packages/telegram-plugin/src/index.ts +++ b/packages/telegram-plugin/src/index.ts @@ -2,8 +2,9 @@ import { Bot } from "@arb-protocol/core"; import { Bot as T } from "grammy"; const MARKER_CHAR = "▌"; -const TELEGRAM_BOT_TOKEN = "GET THIS FROM ENV"; -// TODO: get this from env +const TELEGRAM_BOT_TOKEN = "6041735757:AAEyxGeCag5dzqQGYEwrQgrUeH9f5ANJWQM"; +const CHAT_ID = 12345; + const eventTitle = (title: string) => { return title.padEnd(26, " "); }; @@ -66,7 +67,7 @@ export const TelegramPlugin = (bot: T) => ({ } output && - t.api.sendMessage(1234567890, output).catch((err) => { + t.api.sendMessage(CHAT_ID, output).catch((err) => { console.error("TelegramPlugin: error sending message: ", err); }); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4212987..30329a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,6 +32,9 @@ importers: '@arb-protocol/jupiter-adapter': specifier: 2.0.0-alpha.5 version: link:../../packages/jupiter-adapter + '@arb-protocol/telegram-plugin': + specifier: 2.0.0-alpha.5 + version: link:../../packages/telegram-plugin '@arb-protocol/tui': specifier: 2.0.0-alpha.5 version: link:../../packages/tui @@ -270,6 +273,43 @@ importers: specifier: 5.0.2 version: 5.0.2 + packages/telegram-plugin: + dependencies: + '@arb-protocol/core': + specifier: 2.0.0-alpha.5 + version: link:../core + grammy: + specifier: ^1.16.2 + version: 1.16.2 + devDependencies: + '@arb-protocol/eslint-config': + specifier: 2.0.0-alpha.5 + version: link:../eslint-config + '@types/node': + specifier: ^18.11.10 + version: 18.14.6 + '@typescript-eslint/eslint-plugin': + specifier: ^5.45.0 + version: 5.54.1(@typescript-eslint/parser@5.54.1)(eslint@8.35.0)(typescript@5.0.2) + '@typescript-eslint/parser': + specifier: ^5.45.0 + version: 5.54.1(eslint@8.35.0)(typescript@5.0.2) + eslint: + specifier: ^8.29.0 + version: 8.35.0 + ts-node: + specifier: ^10.9.1 + version: 10.9.1(@types/node@18.14.6)(typescript@5.0.2) + tsconfig: + specifier: 2.0.0-alpha.5 + version: link:../tsconfig + tsup: + specifier: ^6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.2) + typescript: + specifier: 5.0.2 + version: 5.0.2 + packages/tsconfig: {} packages/tui: @@ -1045,6 +1085,10 @@ packages: hash.js: 1.1.7 dev: false + /@grammyjs/types@3.1.1: + resolution: {integrity: sha512-nTNYvk+Al/nXZAMTEzPYEyW6pfgYgNuf/gxfx17kCxjHpAYhV+pcmROuD9eOBDLaBDh/hZJkQTIY6S3CfTAC0Q==} + dev: false + /@hapi/hoek@9.3.0: resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} dev: false @@ -5527,6 +5571,19 @@ packages: tinygradient: 1.1.5 dev: false + /grammy@1.16.2: + resolution: {integrity: sha512-Yex12ZuelqDQKH/gJ+6Fy/mdepUUIJtazLCdu+mD/r9j8abqB59hsx3UgmsWcp0k6hITo/G0aui84Y2q8FueyA==} + engines: {node: ^12.20.0 || >=14.13.1} + dependencies: + '@grammyjs/types': 3.1.1 + abort-controller: 3.0.0 + debug: 4.3.4 + node-fetch: 2.6.11 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + /grapheme-splitter@1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} diff --git a/turbo.json b/turbo.json index 5789d89..0690c8b 100644 --- a/turbo.json +++ b/turbo.json @@ -18,5 +18,5 @@ "cache": false } }, - "globalEnv": ["NODE_ENV", "TUI_INITIAL_SCREEN", "TUI_FPS"] + "globalEnv": ["NODE_ENV", "TUI_INITIAL_SCREEN", "TUI_FPS", "TELEGRAM_BOT_TOKEN"] }