feat: add Telegram bot frontend with message handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
William Valentin
2026-02-02 20:59:17 -08:00
parent 69309e58bc
commit d0fe4c5b35
4 changed files with 144 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import type { NativeAgent } from '../../backends/index.js';
export function isAllowedChat(chatId: number, allowedIds: number[]): boolean {
return allowedIds.includes(chatId);
}
export function createMessageHandler(agent: NativeAgent): (text: string) => Promise<string> {
return async (text: string): Promise<string> => {
return agent.process(text);
};
}
export function createResetHandler(agent: NativeAgent): () => void {
return (): void => {
agent.reset();
};
}