Skip to content

Commit ebe9359

Browse files
authored
Merge pull request elizaOS#2014 from dto-simba/main
feat: add telegram api root config in env
2 parents 7e89342 + dacc541 commit ebe9359

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ HELIUS_API_KEY=
227227

228228
# Telegram Configuration
229229
TELEGRAM_BOT_TOKEN=
230+
TELEGRAM_API_ROOT=
230231

231232
# Together Configuration
232233
TOGETHER_API_KEY=

packages/client-telegram/src/telegramClient.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ export class TelegramClient {
1111
private backend;
1212
private backendToken;
1313
private tgTrader;
14+
private options;
1415

1516
constructor(runtime: IAgentRuntime, botToken: string) {
1617
elizaLogger.log("📱 Constructing new TelegramClient...");
18+
this.options = {
19+
telegram: {
20+
apiRoot: runtime.getSetting("TELEGRAM_API_ROOT") || process.env.TELEGRAM_API_ROOT || "https://api.telegram.org"
21+
},
22+
};
1723
this.runtime = runtime;
18-
this.bot = new Telegraf(botToken);
24+
this.bot = new Telegraf(botToken,this.options);
1925
this.messageManager = new MessageManager(this.bot, this.runtime);
2026
this.backend = runtime.getSetting("BACKEND_URL");
2127
this.backendToken = runtime.getSetting("BACKEND_TOKEN");

0 commit comments

Comments
 (0)