This commit is contained in:
Udit Karode 2023-04-08 10:17:49 +05:30
commit 77c704db49
No known key found for this signature in database
GPG Key ID: 864BAA48465205F0
14 changed files with 821 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/variables.ts
/node_modules
/src/test.ts
/dist

12
.prettierrc Normal file
View File

@ -0,0 +1,12 @@
{
"trailingComma": "all",
"useTabs": true,
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"quoteProps": "consistent",
"jsxSingleQuote": false,
"bracketSpacing": true,
"arrowParens": "avoid",
"printWidth": 80
}

9
README.md Normal file
View File

@ -0,0 +1,9 @@
# Bing Chat Bot
A Telegram bot that lets you interact with the Bing AI from chats that you allow in the config.
To start using this project, please copy `variables.example.ts` to `variables.ts`, and go through it.
Once you've made the required changes to `variables.ts`, you can run `yarn dev` to run the bot.
You can also build the bot using `yarn build` and run it using `yarn start` or `node dist/src`.

24
package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "bing-bot",
"type": "module",
"author": "Udit Karode <udit.karode@gmail.com>",
"version": "0.1",
"license": "MIT",
"scripts": {
"build": "tsc --pretty",
"start": "node dist/src",
"dev": "tsx src/index.ts",
"test": "tsx src/test.ts"
},
"devDependencies": {
"@types/node": "^18.15.9",
"prettier": "^2.8.7",
"tsx": "^3.12.6",
"typegram": "^5.0.0",
"typescript": "^5.0.4"
},
"dependencies": {
"bing-chat": "^0.2.3",
"telegraf": "^4.12.2"
}
}

72
src/ai.ts Normal file
View File

@ -0,0 +1,72 @@
import { bingChat } from "./instances.js";
import { done, firstPos, queue } from "./queue.js";
import { transformBingResponse } from "./transformers.js";
import { ChatMessage } from "bing-chat";
import { Context } from "telegraf";
import { bold, fmt } from "telegraf/format";
import { Update } from "typegram";
const chats: Record<
number,
{ index: number; res?: ChatMessage; variant?: string }
> = {};
export const variants = ["creative", "balanced", "precise"];
const defaultVariant = "Balanced";
export async function ai(ctx: Context<Update>, prompt: string) {
try {
const chatId = ctx.chat!.id;
chats[chatId] ||= { index: 1 };
const { pos, turn } = queue();
if (pos > firstPos) {
await ctx.reply(fmt`Queued at position: ${bold`${pos}`}`);
await turn;
}
const { message_id } = await ctx.reply(
fmt`${bold`[${chats[chatId].index++}]`} Running prompt...`,
);
const bingRes = await bingChat.sendMessage(
prompt,
Object.assign({}, chats[chatId].res, {
variant: chats[chatId].variant ?? defaultVariant,
}),
);
chats[chatId].res = bingRes;
let tgRes = transformBingResponse(bingRes);
// Bing Chat often replies with the exact prompt
// in case it's unable to continue the conversation.
if (tgRes.text === prompt && !tgRes.entities) {
tgRes = fmt`Something went wrong. Starting a new chat with /newchat is recommended.`;
}
await ctx.telegram.editMessageText(chatId, message_id, undefined, tgRes, {
disable_web_page_preview: true,
});
} catch (e) {
console.log(e);
await ctx.reply("Something went wrong!");
} finally {
done();
}
}
export function newChat(chatId: number) {
delete chats[chatId].res;
chats[chatId].index = 1;
}
export function getVariant(chatId: number) {
return chats[chatId]?.variant ?? defaultVariant;
}
export function setVariant(chatId: number, variant: string) {
chats[chatId] ||= { index: 1 };
variant = variant.toLowerCase();
chats[chatId].variant = variant.charAt(0).toUpperCase() + variant.slice(1);
}

9
src/check-origin.ts Normal file
View File

@ -0,0 +1,9 @@
import { Context, Middleware } from "telegraf";
export const checkOrigin =
(allowedIds: readonly number[] | number[]): Middleware<Context> =>
(ctx, next) => {
const chatId = ctx.chat?.id;
if (chatId && allowedIds.includes(chatId)) next();
else ctx.reply("Unable to proceed in this chat!");
};

129
src/fmt-replace.ts Normal file
View File

@ -0,0 +1,129 @@
// This code is licensed under the MIT License
// Copyright (c) MKRhere (https://mkr.pw)
import { FmtString } from "telegraf/format";
import { MessageEntity } from "typegram";
interface EntityCompare {
offset: number;
length: number;
}
/** get the starting of the entity */
const starts = (e: EntityCompare) => e.offset;
/** get the ending of the entity */
const ends = (e: EntityCompare) => e.offset + e.length;
const before = (A: EntityCompare, B: EntityCompare) =>
// B ends before A starts
ends(B) <= starts(A);
const after = (A: EntityCompare, B: EntityCompare) =>
// B starts after A ends
starts(B) >= ends(A);
const inside = (A: EntityCompare, B: EntityCompare) =>
// B starts with/after A and ends before A
(starts(B) >= starts(A) && ends(B) < ends(A)) ||
// B starts after A and ends before/with A
(starts(B) > starts(A) && ends(B) <= ends(A));
const contains = (A: EntityCompare, B: EntityCompare) =>
// B starts before/with A and ends with/after A
starts(B) <= starts(A) && ends(B) >= ends(A);
const endsInside = (A: EntityCompare, B: EntityCompare) =>
// B starts before A starts, ends after A starts, ends before B ends
starts(B) < starts(A) && ends(B) > starts(A) && ends(B) < ends(A);
const startsInside = (A: EntityCompare, B: EntityCompare) =>
// B starts after A, starts before A ends, ends after A
starts(B) > starts(A) && starts(B) < ends(A) && ends(B) > ends(A);
export const replace = (
source: string | FmtString,
search: string | RegExp,
value: string | FmtString | ((...match: string[]) => string | FmtString),
): FmtString => {
source = FmtString.normalise(source);
let text = source.text;
let entities: MessageEntity[] | undefined = source.entities;
function fixEntities(offset: number, length: number, correction: number) {
const A = { offset, length };
return (entities || [])
.map(E => {
if (before(A, E)) return E;
if (inside(A, E)) return;
if (after(A, E)) return { ...E, offset: E.offset + correction };
if (contains(A, E)) return { ...E, length: E.length + correction };
if (endsInside(A, E))
return { ...E, length: E.length - (ends(E) - starts(A)) };
if (startsInside(A, E)) {
const entityInside = ends(A) - starts(E);
return {
...E,
offset: E.offset + entityInside + correction,
length: E.length - entityInside,
};
}
throw new Error(
"Entity found in an unexpected condition. " +
"This is probably a bug in telegraf. " +
"You should report this to https://github.com/telegraf/telegraf/issues",
);
})
.filter((x): x is MessageEntity => Boolean(x));
}
if (typeof search === "string") {
const replace = FmtString.normalise(
typeof value === "function" ? value(...search) : value,
);
const offset = text.indexOf(search);
const length = search.length;
text = text.slice(0, offset) + replace.text + text.slice(offset + length);
const currentCorrection = replace.text.length - length;
entities = [
...fixEntities(offset, length, currentCorrection),
...(replace.entities || []).map(E => ({
...E,
offset: E.offset + offset,
})),
];
} else {
let index = 0; // context position in text string
let acc = ""; // incremental return value
let correction = 0;
let regexArray: RegExpExecArray | null;
while ((regexArray = search.exec(text))) {
const match = regexArray[0];
const offset = regexArray.index;
const length = match.length;
const replace = FmtString.normalise(
typeof value === "function" ? value(...regexArray) : value,
);
acc += text.slice(index, offset) + replace.text;
const currentCorrection = replace.text.length - length;
entities = [
...fixEntities(offset + correction, length, currentCorrection),
...(replace.entities || []).map(E => ({
...E,
offset: E.offset + offset + correction,
})),
];
correction += currentCorrection;
index = offset + length;
}
text = acc + text.slice(index);
}
return new FmtString(text, entities);
};

66
src/index.ts Normal file
View File

@ -0,0 +1,66 @@
import { ALLOWED_CHAT_IDS } 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";
function args(cmd: string) {
return cmd.split(" ").splice(1).join(" ");
}
async function main() {
bot.use(useNewReplies());
if (typeof ALLOWED_CHAT_IDS != "string") {
bot.use(checkOrigin(ALLOWED_CHAT_IDS));
}
bot.command("ai", async ctx => {
await ai(ctx, args(ctx.message.text));
});
bot.on(message("reply_to_message"), async ctx => {
if (ctx.message.reply_to_message.from?.id != ctx.botInfo.id) return;
const reply = ctx.message.reply_to_message;
const message = ctx.message;
if ("text" in reply && "text" in message) {
await ai(ctx, message.text);
}
});
bot.command("newchat", async ctx => {
newChat(ctx.chat.id);
await ctx.reply(
"The previous chat has been cleared. Any new /ai commands will continue a new chat.",
);
});
bot.command("variant", async ctx => {
const variant = args(ctx.message.text);
if (!variant)
return await ctx.reply(
`Variant for this chat is '${getVariant(ctx.chat.id)}'`,
);
if (!variants.includes(variant))
return await ctx.reply(
`Invalid variant. Please use /help to learn about valid variants.`,
);
setVariant(ctx.chat.id, variant);
await ctx.reply(`The variant for this chat has been set to '${variant}'`);
});
bot.launch();
console.log("Bot running!");
console.log("Use ^C to stop");
// Enable graceful stop
process.once("SIGINT", () => bot.stop("SIGINT"));
process.once("SIGTERM", () => bot.stop("SIGTERM"));
}
main();

10
src/instances.ts Normal file
View File

@ -0,0 +1,10 @@
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());

36
src/queue.ts Normal file
View File

@ -0,0 +1,36 @@
import EventEmitter from "events";
const emitter = new EventEmitter();
export const zerothPos = -1;
export const firstPos = zerothPos + 1;
let clients = zerothPos;
export function queue() {
const pos = ++clients;
return {
pos,
turn:
pos == firstPos
? // if this is the first client in the queue, no need to wait
Promise.resolve(pos)
: // otherwise, wait for our turn
new Promise<number>(r => {
const listener = (donePos: number) => {
if (donePos == pos) {
emitter.off("done", listener);
r(pos);
}
};
emitter.on("done", listener);
}),
};
}
export function done() {
if (clients == zerothPos) return;
emitter.emit("done", clients--);
}

69
src/transformers.ts Normal file
View File

@ -0,0 +1,69 @@
import { replace } from "./fmt-replace.js";
import { ChatMessage } from "bing-chat";
import { FmtString, bold, code, fmt, italic, link, pre } from "telegraf/format";
type Transformers = ((reply: FmtString, res: ChatMessage) => FmtString)[];
export function transformBingResponse(res: ChatMessage) {
return transformers.reduce(
(text, transformer) => transformer(text, res),
new FmtString(res.text),
);
}
export const transformers: Transformers = [
function addNewChatSuffix(reply) {
const lowercaseReply = reply.text.toLowerCase();
const triggers = [
"“new topic",
"prefer not to continue",
"still learning so I appreciate your understanding and patience",
];
if (triggers.some(trigger => lowercaseReply.includes(trigger)))
return fmt`${reply}\n\nUse /newchat to start a new topic.`;
return reply;
},
function styleBold(reply) {
return replace(reply, /\*\*(.*?)\*\*/g, (_, txt) => bold(txt));
},
function styleItalic(reply) {
return replace(reply, /_(.*?)_/g, (_, txt) => italic(txt));
},
function styleAlternateItalic(reply) {
return replace(reply, /\*(.*?)\*/g, (_, txt) => italic(txt));
},
function styleCode(reply) {
return replace(reply, /`(.*?)`/g, (_, codeString) => code(codeString));
},
function styleReferences(reply, res) {
const references = res.detail?.sourceAttributions;
if (!references) return reply;
return replace(reply, /\[\^(.)\^\]/g, (_, oneBasedIndex) => {
const referenceLink = references[parseInt(oneBasedIndex) - 1]?.seeMoreUrl;
if (!referenceLink) return "";
return fmt` ${bold(link(`[${oneBasedIndex}]`, referenceLink))}`;
});
},
function stylePre(reply) {
return replace(
reply,
/```(\w+)\n([\s\S]*?)```/g,
(_, language, codeString) => {
return pre(language)(codeString);
},
);
},
function styleAlternateBold(reply) {
return replace(reply, /^`\n(.*?)`/gms, (_, txt) => bold(txt));
},
];

15
tsconfig.json Normal file
View File

@ -0,0 +1,15 @@
{
"compilerOptions": {
"outDir": "./dist",
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "NodeNext",
"strict": true,
"sourceMap": true,
"declaration": true,
"noErrorTruncation": true,
"esModuleInterop": true
},
"include": ["*.ts", "src/**/*.ts"],
"exclude": ["node_modules", "lib"]
}

22
variables.example.ts Normal file
View File

@ -0,0 +1,22 @@
export const ALLOWED_CHAT_IDS: string | number[] = (() => {
// If you want to allow usage in all chats, uncomment the line below:
// return "all";
return [
// Enter the chat IDs you want to allow usage in here.
];
})();
// Enter 'document.cookie' in the console on bing.com,
// and paste the result here. You must be logged in to
// your Microsoft account and have access to Bing Chat.
// PS: don't worry about the newlines, they will be trimmed
export const BING_COOKIE = `
`;
// Paste the bot token you got from BotFather in here.
// PS: don't worry about the newlines, they will be trimmed
export const TG_TOKEN = `
`;

344
yarn.lock Normal file
View File

@ -0,0 +1,344 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@esbuild-kit/cjs-loader@^2.4.2":
version "2.4.2"
resolved "https://registry.yarnpkg.com/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz#cb4dde00fbf744a68c4f20162ea15a8242d0fa54"
integrity sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==
dependencies:
"@esbuild-kit/core-utils" "^3.0.0"
get-tsconfig "^4.4.0"
"@esbuild-kit/core-utils@^3.0.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz#49945d533dbd5e1b7620aa0fc522c15e6ec089c5"
integrity sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw==
dependencies:
esbuild "~0.17.6"
source-map-support "^0.5.21"
"@esbuild-kit/esm-loader@^2.5.5":
version "2.5.5"
resolved "https://registry.yarnpkg.com/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz#b82da14fcee3fc1d219869756c06f43f67d1ca71"
integrity sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw==
dependencies:
"@esbuild-kit/core-utils" "^3.0.0"
get-tsconfig "^4.4.0"
"@esbuild/android-arm64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.13.tgz#88e5b6afe65ef3168b0eb6dc93fdb1b15f4653c9"
integrity sha512-F5DgvJMV2ZEpLNpPCO7FEk1wy8O5tg6cikWSB6uvvncsgE1xgbPlm+Boio/4820C2/mj713X83X1h01v0qoeHg==
"@esbuild/android-arm@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.13.tgz#5a1cfd20453eb1c8a64602069d3e2187a2278b34"
integrity sha512-5tZZ/hLIfBmt7E8JsE5KbsknoAFmoElkg+A/gjyPtmSQvJjPf+9GsSJihid8VMa08lrsYyaEXOT9RLh3xXQONw==
"@esbuild/android-x64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.13.tgz#4228fef54b7c9c0167693f634301648a9a35d7e4"
integrity sha512-5m1UUslzpfVrumG3m3Zv2x9VNAcvMOQWJy009y6jt10tcHpzIq2/b0I0k4fz0QYqGSNS1GteRIhVPN4H7OyCXg==
"@esbuild/darwin-arm64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.13.tgz#83964a0ded926c1ef16f5329b80cf505d073e4da"
integrity sha512-TXbXp/05r7heRsG8yWwbHw9diay+wXIyRNcIHFoNARRIGahYbTW/qwJzE37zkfxLIUPHgR/SyLTUlnTICg14ag==
"@esbuild/darwin-x64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.13.tgz#330ad462247e5109079efbc1c782c981e584913f"
integrity sha512-Ku9Db2sblCxFvQdEO7X9nBaLR/S81uch81e2Q2+Os5z1NcnsFjuqhIYH0Gm6KNNpIKaEbC7gCLbiIPbLLMX4Pg==
"@esbuild/freebsd-arm64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.13.tgz#59ca41062922c759ad32421d93a6fa0e85290a6b"
integrity sha512-t1T5/nIf2j+FdSf1Fa3dcU0cXycr0nK4xJe52qjWa+1I249mM5NBY1ODjiabZxZ0x3CG05y4fd9bxfDLy9kQtA==
"@esbuild/freebsd-x64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.13.tgz#349b22850b18323690f90127117d83f351303a7b"
integrity sha512-/zbkgEO4gY2qGZr9UNAGI38w/FwUY4bx4EC88k9VeiCKNr3ukNgwH/oIgB5Z9/OqpkNLlcS4w9e2d/MIiy5fbw==
"@esbuild/linux-arm64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.13.tgz#92aa31b0ef1521506e14c27bb960f18eaee5c31f"
integrity sha512-siu3QZrQ7eGrSttvFaRKyjT7kNRbUuHEKzCCyqRh19MbpGokGY13jbIsBEjx6JmH3T50hds325oweS9Ey2ihAQ==
"@esbuild/linux-arm@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.13.tgz#3ebbf4764c36f90e58a6342f67844f7628988faf"
integrity sha512-RrhjzrCF6aCDH248nUAQoldnRmN7nHMxv85GOj5AH+qkxxYvcig7fnUmgANngntRu4btXhN9WKHMgQ5seERDMw==
"@esbuild/linux-ia32@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.13.tgz#7c10f44eed774d6e5ebe652af30e3703819314f6"
integrity sha512-ADHA1PqP5gIegehVP0RvxMmNPxpLgetI8QCwYOjUheGXKIKWSdUN8ZS3rusQv3NGZmFCpYdMZzFoI0QtzzGAdw==
"@esbuild/linux-loong64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.13.tgz#80def2d6b0f636deb915ca17353aed42c668e3f7"
integrity sha512-n1JQPxETmR0brkpWlJHeohReEPLH+m00bnJdNnFyHN3zLBt1QypevuZSmnmFWsC+7r7HTwWILj3lBDjtPH3ydg==
"@esbuild/linux-mips64el@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.13.tgz#4d80d34c1ab79c57f5df819e45e555a695c840ab"
integrity sha512-d0pnD/j5KKQ43xtSIvOD+wNIy6D/Vh9GbXVRa3u4zCyiJMYWjxkPkbBzlEgNjdDmUM+5gBFen9k7B8Xscy+Myg==
"@esbuild/linux-ppc64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.13.tgz#7b668c77ecd58b499622e360400670a8a57697b8"
integrity sha512-C9sMpa/VcGLjVtsT01sXtzZNS7bAZ+icUclkKkiUwBQ9hzT+J+/Xpj+EykI5hB3KgtxQVo4XUahanFoZNxbQ1g==
"@esbuild/linux-riscv64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.13.tgz#b2b8cdb6a444e86dcbfb16cb3e5a99d7eaf75c41"
integrity sha512-jYkc5EpNpvjccAHNYekiAtklusVGWftR0VVLtng7dJzDyy+5adAsf1fOG3LllP0WALxS55/w6boLE/728J/bXw==
"@esbuild/linux-s390x@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.13.tgz#38dd0677b876c29280785b18cafc1673961e7f8e"
integrity sha512-4jAJI5O6E/hATL4lsrG2A+noDjZ377KlATVFKwV3SWaNHj+OvoXe/T84ScQIXEtPI7ndJyLkMYruXj8RR5Ilyw==
"@esbuild/linux-x64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.13.tgz#0fed27e7dd7c5b00d9d53c3759a1fc3b6b1dec53"
integrity sha512-eFLQhJq98qijGRcv9je/9M4Mz1suZ+pOtj62ArsLd0gubNGhhQDz6T30X2X3f1KZ8lkKkr+zN5vtZzx1GAMoFw==
"@esbuild/netbsd-x64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.13.tgz#5db5d517bd6395e63452a59cd4b00c12eb584c3a"
integrity sha512-F8PXDeT+3eQpPjf4bmNJapPLu0SKKlWRGPQvBQqVS+YDGoMKnyyYp2UENLFMV8zT7kS39zKxZRZvUL3fMz/7Ww==
"@esbuild/openbsd-x64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.13.tgz#d2270dad94a50b78eb67360a85ad45212ac6783b"
integrity sha512-9jWfzbFCnIZdHjNs+00KQHArUbp7kjQDNmiuqkwGOQFs67m4/dKNupBv2DP5hTqVlQY4tW4RG3qpb6Y3zOHJeA==
"@esbuild/sunos-x64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.13.tgz#716382743f17c080b17a782346c33c976e10345e"
integrity sha512-ALbOMlTIBkAVi6KqYjONa7u2oH95RN7OpetFqMtjufFLBiSaayRuwUzhs2yuR9CfGT4qi0jv6HQDav+EG314TQ==
"@esbuild/win32-arm64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.13.tgz#e9527611f3c9d2c2be61c86d4eb9077c060cdb39"
integrity sha512-FJBLYL4PkrZGeuHzEqme+0DjNetxkJ+XbB+Aoeow7aQ53JCwsA0/mo8sS5aPkDHgCnMkN4A5GLoFTlDj3BKDrQ==
"@esbuild/win32-ia32@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.13.tgz#f5a1f05254852a6f511af5e1a86afbda807fe8c8"
integrity sha512-Qrvst9RkLz4qgi3hqswNliYuKW92/HGJnd7xLWkGaGPa8S4qsONf81FW0ebDc5iUHb0I7QJwQATutvghTabnFA==
"@esbuild/win32-x64@0.17.13":
version "0.17.13"
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.13.tgz#eca2698440d931b5a0fb8a5a29388c17adcb6bf5"
integrity sha512-pZ/NIgz861XaUPlIkPFjP55nJ4PJa0o/CD4zgeRb1Q9FVE+8GvdB6ifJcK05jRhny5hKExhnRFIdgHmmCYH8vg==
"@types/node@^18.15.9":
version "18.15.11"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f"
integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==
abort-controller@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==
dependencies:
event-target-shim "^5.0.0"
bing-chat@^0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/bing-chat/-/bing-chat-0.2.3.tgz#aba19c55e5dfbe12ceae6e26cbbaf405c146703f"
integrity sha512-q9JIGqrrEhBEgIhTdtawvxcwQO5sdhMN3uATbLxpd52sH0+Jm7QhtsaodlLUbQgEQGo+YXfFPWWpK5lWMXGvHw==
dependencies:
ws "^8.13.0"
buffer-alloc-unsafe@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0"
integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==
buffer-alloc@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec"
integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==
dependencies:
buffer-alloc-unsafe "^1.1.0"
buffer-fill "^1.0.0"
buffer-fill@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c"
integrity sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==
buffer-from@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"
esbuild@~0.17.6:
version "0.17.13"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.13.tgz#463066919a5567e8d1f4781004129da7fc8774b6"
integrity sha512-4ixMwdErBcQHgTBeoxnowENCPKWFAGxgTyKHMK8gqn9sZaC7ZNWFKtim16g2rzQ2b/FYyy3lIUUJboFtjolhqg==
optionalDependencies:
"@esbuild/android-arm" "0.17.13"
"@esbuild/android-arm64" "0.17.13"
"@esbuild/android-x64" "0.17.13"
"@esbuild/darwin-arm64" "0.17.13"
"@esbuild/darwin-x64" "0.17.13"
"@esbuild/freebsd-arm64" "0.17.13"
"@esbuild/freebsd-x64" "0.17.13"
"@esbuild/linux-arm" "0.17.13"
"@esbuild/linux-arm64" "0.17.13"
"@esbuild/linux-ia32" "0.17.13"
"@esbuild/linux-loong64" "0.17.13"
"@esbuild/linux-mips64el" "0.17.13"
"@esbuild/linux-ppc64" "0.17.13"
"@esbuild/linux-riscv64" "0.17.13"
"@esbuild/linux-s390x" "0.17.13"
"@esbuild/linux-x64" "0.17.13"
"@esbuild/netbsd-x64" "0.17.13"
"@esbuild/openbsd-x64" "0.17.13"
"@esbuild/sunos-x64" "0.17.13"
"@esbuild/win32-arm64" "0.17.13"
"@esbuild/win32-ia32" "0.17.13"
"@esbuild/win32-x64" "0.17.13"
event-target-shim@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
fsevents@~2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
get-tsconfig@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.4.0.tgz#64eee64596668a81b8fce18403f94f245ee0d4e5"
integrity sha512-0Gdjo/9+FzsYhXCEFueo2aY1z1tpXrxWZzP7k8ul9qt1U5o8rYJwTJYmaeHdrVosYIVYkOy2iwCJ9FdpocJhPQ==
mri@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b"
integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==
ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
node-fetch@^2.6.8:
version "2.6.9"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6"
integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==
dependencies:
whatwg-url "^5.0.0"
p-timeout@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-4.1.0.tgz#788253c0452ab0ffecf18a62dff94ff1bd09ca0a"
integrity sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==
prettier@^2.8.7:
version "2.8.7"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450"
integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==
safe-compare@^1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/safe-compare/-/safe-compare-1.1.4.tgz#5e0128538a82820e2e9250cd78e45da6786ba593"
integrity sha512-b9wZ986HHCo/HbKrRpBJb2kqXMK9CEWIE1egeEvZsYn69ay3kdfl9nG3RyOcR+jInTDf7a86WQ1d4VJX7goSSQ==
dependencies:
buffer-alloc "^1.2.0"
sandwich-stream@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/sandwich-stream/-/sandwich-stream-2.0.2.tgz#6d1feb6cf7e9fe9fadb41513459a72c2e84000fa"
integrity sha512-jLYV0DORrzY3xaz/S9ydJL6Iz7essZeAfnAavsJ+zsJGZ1MOnsS52yRjU3uF3pJa/lla7+wisp//fxOwOH8SKQ==
source-map-support@^0.5.21:
version "0.5.21"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
source-map@^0.6.0:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
telegraf@^4.12.2:
version "4.12.2"
resolved "https://registry.yarnpkg.com/telegraf/-/telegraf-4.12.2.tgz#1cf4f38c275e04416f1282f3581833994870f0bc"
integrity sha512-PgwqI4wD86cMqVfFtEM9JkGGnMHgvgLJbReZMmwW4z35QeOi4DvbdItONld4bPnYn3A1jcO0SRKs0BXmR+x+Ew==
dependencies:
abort-controller "^3.0.0"
debug "^4.3.4"
mri "^1.2.0"
node-fetch "^2.6.8"
p-timeout "^4.1.0"
safe-compare "^1.1.4"
sandwich-stream "^2.0.2"
typegram "^4.3.0"
tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==
tsx@^3.12.6:
version "3.12.6"
resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.12.6.tgz#36b3693e48b8392da374487190972c7b80e433b4"
integrity sha512-q93WgS3lBdHlPgS0h1i+87Pt6n9K/qULIMNYZo07nSeu2z5QE2CellcAZfofVXBo2tQg9av2ZcRMQ2S2i5oadQ==
dependencies:
"@esbuild-kit/cjs-loader" "^2.4.2"
"@esbuild-kit/core-utils" "^3.0.0"
"@esbuild-kit/esm-loader" "^2.5.5"
optionalDependencies:
fsevents "~2.3.2"
typegram@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/typegram/-/typegram-4.3.0.tgz#690ec1287f771608070e149c92de4fca42e54db0"
integrity sha512-pS4STyOZoJ++Mwa9GPMTNjOwEzMkxFfFt1By6IbMOJfheP0utMP/H1ga6J9R4DTjAYBr0UDn4eQg++LpWBvcAg==
typegram@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/typegram/-/typegram-5.0.0.tgz#1b3f1b36a4dba0b189d5ad0dc659c343648e4be2"
integrity sha512-6Z4klKmEsDKfN8dLEf8Buh6vZk1RMGUgOJscVSRXbM+RiiRgjeabc2NucR4e+RoQ1m3mwMjbi+Td+TbrQTWT+g==
typescript@^5.0.4:
version "5.0.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==
webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==
whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==
dependencies:
tr46 "~0.0.3"
webidl-conversions "^3.0.0"
ws@^8.13.0:
version "8.13.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0"
integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==