Connect Horus Chat to Telegram (Horus)

This commit is contained in:
root
2026-02-22 16:40:52 +00:00
parent 98334847dc
commit d97e88a8c1
3 changed files with 104 additions and 23 deletions
+24
View File
@@ -0,0 +1,24 @@
import { NextResponse } from "next/server";
import fs from "fs";
const RESPONSE_FILE = "/tmp/horus-mc-response.txt";
export async function GET() {
try {
// Check if there's a response file
if (fs.existsSync(RESPONSE_FILE)) {
const response = fs.readFileSync(RESPONSE_FILE, "utf-8").trim();
if (response) {
// Clear the file after reading
fs.writeFileSync(RESPONSE_FILE, "");
return NextResponse.json({ response });
}
}
return NextResponse.json({ response: null });
} catch (error) {
console.error("Error:", error);
return NextResponse.json({ response: null });
}
}