bump libs

migrate to typescript 6
remove ytdl feature
This commit is contained in:
2026-05-01 07:05:17 +03:00
parent ac51702f00
commit 13b41c3026
56 changed files with 1069 additions and 1857 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ export class Environment {
static ollamaCancelledText = "```Ollama\n❌ Отменено```";
static load() {
Environment.BOT_TOKEN = process.env.BOT_TOKEN;
Environment.BOT_TOKEN = <string>process.env.BOT_TOKEN;
Environment.TEST_ENVIRONMENT = ifTrue(process.env.TEST_ENVIRONMENT);
Environment.CHAT_IDS_WHITELIST = new Set(process.env.CHAT_IDS_WHITELIST?.split(",")?.map(e => parseInt(e.trim(), 10)) || []);
Environment.BOT_PREFIX = process.env.BOT_PREFIX || "";
+8 -4
View File
@@ -15,14 +15,16 @@ export class MessageStore {
}
static async put(m: Message | StoredMessage): Promise<StoredMessage> {
const maxSizePath = isStoredMessage(m) ? null : getPhotoMaxSize(m.photo)?.file_unique_id;
const msg: StoredMessage = isStoredMessage(m) ? m : {
chatId: m.chat.id,
id: m.message_id,
replyToMessageId: m.reply_to_message?.message_id ?? null,
fromId: m.from.id,
replyToMessageId: m.reply_to_message?.message_id,
fromId: <number>m.from?.id,
text: extractTextMessage(m),
date: m.date ?? 0,
photoMaxSizeFilePath: m.photo ? [getPhotoMaxSize(m.photo).file_unique_id] : null
photoMaxSizeFilePath: maxSizePath ? [maxSizePath] : undefined,
};
this.map.set(this.key(msg.chatId, msg.id), msg);
@@ -30,7 +32,9 @@ export class MessageStore {
return msg;
}
static async get(chatId: number, messageId: number): Promise<StoredMessage | null> {
static async get(chatId: number, messageId: number | undefined): Promise<StoredMessage | null> {
if (!messageId) return null;
const message = await messageDao.getById({chatId: chatId, id: messageId});
if (!message) return null;