cleanup: move variables around

This commit is contained in:
Udit Karode 2023-04-08 11:32:28 +05:30
parent cc5059c0ad
commit 178f00147c
No known key found for this signature in database
GPG Key ID: 864BAA48465205F0
3 changed files with 10 additions and 15 deletions

View File

@ -1,10 +1,14 @@
import { bingChat } from "./instances.js";
import { done, firstPos, queue } from "./queue.js";
import { transformBingResponse } from "./transformers.js";
import { ChatMessage } from "bing-chat";
import { BingChat, ChatMessage } from "bing-chat";
import { Context } from "telegraf";
import { FmtString, bold, fmt } from "telegraf/format";
import { bold, fmt } from "telegraf/format";
import { Update } from "typegram";
import { BING_COOKIE } from "../variables.js";
export const bingChat = new BingChat({
cookie: BING_COOKIE.replaceAll('"', "").trim(),
});
const chats: Record<
number,

View File

@ -1,16 +1,17 @@
import { bold, code, fmt, underline } from "telegraf/format";
import { ALLOWED_CHAT_IDS } from "../variables.js";
import { ALLOWED_CHAT_IDS, TG_TOKEN } from "../variables.js";
import { ai, getVariant, newChat, setVariant, variants } from "./ai.js";
import { checkOrigin } from "./check-origin.js";
import { bot } from "./instances.js";
import { message } from "telegraf/filters";
import { useNewReplies } from "telegraf/future";
import { Telegraf } from "telegraf";
function args(cmd: string) {
return cmd.split(" ").splice(1).join(" ");
}
async function main() {
const bot = new Telegraf(TG_TOKEN.trim());
bot.use(useNewReplies());
if (typeof ALLOWED_CHAT_IDS != "string") {

View File

@ -1,10 +0,0 @@
import { BING_COOKIE, TG_TOKEN } from "../variables.js";
import { BingChat } from "bing-chat";
import { Context, Telegraf } from "telegraf";
import { Update } from "typegram";
export const bingChat = new BingChat({
cookie: BING_COOKIE.replaceAll('"', "").trim(),
});
export const bot: Telegraf<Context<Update>> = new Telegraf(TG_TOKEN.trim());