Skip to content

Commit

Permalink
neuro coder
Browse files Browse the repository at this point in the history
  • Loading branch information
katsuhira02 committed Jul 12, 2024
1 parent 6261530 commit 638cbec
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 128 deletions.
9 changes: 9 additions & 0 deletions supabase/functions/_shared/telegram/bots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ if (!Deno.env.get("TELEGRAM_BOT_BUG_CATCHER_DEV")) {
throw new Error("TELEGRAM_BOT_BUG_CATCHER_DEV is not set");
}

if (!Deno.env.get("TELEGRAM_NEURO_CODER_TOKEN")) {
throw new Error("TELEGRAM_NEURO_CODER_TOKEN is not set");
}
export const bugCatcherDevBotToken = Deno.env.get(
"TELEGRAM_BOT_BUG_CATCHER_DEV",
);
Expand All @@ -70,6 +73,7 @@ export const aiKosheyUrl = Deno.env.get("AI_KOSHEY_URL");
export const aiKosheyFlowiseToken = Deno.env.get("AI_KOSHEY_FLOWISE_TOKEN");

const tokenProd = Deno.env.get("TELEGRAM_BOT_TOKEN_AI_KOSHEY");
const tokenProdNeuro = Deno.env.get("TELEGRAM_NEURO_CODER_TOKEN");
const tokenTest = Deno.env.get("TELEGRAM_BOT_TOKEN_AI_KOSHEY_TEST");
export const supportChatId = Deno.env.get("SUPPORT_CHAT_ID");
export const logBotToken = Deno.env.get("TELEGRAM_BOT_TOKEN_LOG");
Expand All @@ -81,6 +85,7 @@ console.log(botUsername, "botUsername");

const token = DEV ? tokenTest : tokenProd;

const neuroToken = DEV ? tokenTest : tokenProdNeuro
interface SessionData {
id?: string;
session?: string;
Expand All @@ -94,7 +99,9 @@ interface Message {
session_id: string;
}
if (!token) throw new Error("Token Ai Koshy is not set");
if (!neuroToken) throw new Error("Token NeuroCoder is not set")
export const botAiKoshey = new Bot<AiKosheyContext>(token);
export const botNeuroCoder = new Bot<Context>(neuroToken);

if (!logBotToken) throw new Error("Token Log Bot is not set");
export const logBot = new Bot(logBotToken);
Expand Down Expand Up @@ -148,6 +155,8 @@ export const supportRequest = async (title: string, data: any) => {
export const handleUpdateAiKoshey = webhookCallback(botAiKoshey, "std/http");
console.log(handleUpdateAiKoshey, "handleUpdateAiKoshey");

export const handleUpdateNeuroCoder = webhookCallback(botNeuroCoder, "std/http");

export const handleUpdateJavaScript = webhookCallback(
javaScriptDevBot,
"std/http",
Expand Down
Loading

0 comments on commit 638cbec

Please sign in to comment.