mirror of
https://github.com/uditkarode/bing-chat-telegram.git
synced 2025-02-22 09:12:21 +00:00
cleanup: move variables around
This commit is contained in:
parent
cc5059c0ad
commit
178f00147c
10
src/ai.ts
10
src/ai.ts
@ -1,10 +1,14 @@
|
|||||||
import { bingChat } from "./instances.js";
|
|
||||||
import { done, firstPos, queue } from "./queue.js";
|
import { done, firstPos, queue } from "./queue.js";
|
||||||
import { transformBingResponse } from "./transformers.js";
|
import { transformBingResponse } from "./transformers.js";
|
||||||
import { ChatMessage } from "bing-chat";
|
import { BingChat, ChatMessage } from "bing-chat";
|
||||||
import { Context } from "telegraf";
|
import { Context } from "telegraf";
|
||||||
import { FmtString, bold, fmt } from "telegraf/format";
|
import { bold, fmt } from "telegraf/format";
|
||||||
import { Update } from "typegram";
|
import { Update } from "typegram";
|
||||||
|
import { BING_COOKIE } from "../variables.js";
|
||||||
|
|
||||||
|
export const bingChat = new BingChat({
|
||||||
|
cookie: BING_COOKIE.replaceAll('"', "").trim(),
|
||||||
|
});
|
||||||
|
|
||||||
const chats: Record<
|
const chats: Record<
|
||||||
number,
|
number,
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
import { bold, code, fmt, underline } from "telegraf/format";
|
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 { ai, getVariant, newChat, setVariant, variants } from "./ai.js";
|
||||||
import { checkOrigin } from "./check-origin.js";
|
import { checkOrigin } from "./check-origin.js";
|
||||||
import { bot } from "./instances.js";
|
|
||||||
import { message } from "telegraf/filters";
|
import { message } from "telegraf/filters";
|
||||||
import { useNewReplies } from "telegraf/future";
|
import { useNewReplies } from "telegraf/future";
|
||||||
|
import { Telegraf } from "telegraf";
|
||||||
|
|
||||||
function args(cmd: string) {
|
function args(cmd: string) {
|
||||||
return cmd.split(" ").splice(1).join(" ");
|
return cmd.split(" ").splice(1).join(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
const bot = new Telegraf(TG_TOKEN.trim());
|
||||||
bot.use(useNewReplies());
|
bot.use(useNewReplies());
|
||||||
|
|
||||||
if (typeof ALLOWED_CHAT_IDS != "string") {
|
if (typeof ALLOWED_CHAT_IDS != "string") {
|
||||||
|
@ -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());
|
|
Loading…
x
Reference in New Issue
Block a user