This commit is contained in:
Andrey Kondratev
2025-08-29 10:57:50 +05:00
parent 6bde4bfd4c
commit b483ed71f2
11 changed files with 106 additions and 50 deletions

View File

@@ -84,7 +84,7 @@ export class QuixoticBot {
await this.bot.sendMessage(chatId,
'🎵 Добро пожаловать в Quixotic!\n\n' +
'Найди любую песню на YouTube и получи MP3 файл прямо в чат.\n\n' +
'Найди любую песню на SoundCloud и получи MP3 файл прямо в чат.\n\n' +
'Нажми кнопку ниже, чтобы начать поиск:',
{ reply_markup: keyboard }
);
@@ -98,7 +98,7 @@ export class QuixoticBot {
this.bot.onText(/\/help/, async (msg: Message) => {
const chatId = msg.chat.id;
const helpText = `🎵 *Quixotic - YouTube to MP3*
const helpText = `🎵 *Quixotic - SoundCloud to MP3*
*Как пользоваться:*
1⃣ Нажми кнопку "Открыть Quixotic"
@@ -112,8 +112,8 @@ export class QuixoticBot {
/history - История поиска
*Возможности:*
✅ Поиск по YouTube
✅ Высокое качество MP3 (128kbps)
✅ Поиск по SoundCloud
✅ Высокое качество MP3 (192kbps)
✅ Быстрая конвертация
✅ История поиска`;
@@ -218,19 +218,7 @@ export class QuixoticBot {
}
private async getSearchHistory(userId: number): Promise<SearchResult[]> {
return new Promise((resolve, reject) => {
this.db['db'].all(
`SELECT query, created_at FROM search_history
WHERE user_id = ?
ORDER BY created_at DESC
LIMIT 10`,
[userId],
(err: Error | null, rows: SearchResult[]) => {
if (err) reject(err);
else resolve(rows || []);
}
);
});
return this.db.getSearchHistory(userId);
}
private async sendAudioFile(chatId: number, audioUrl: string, title: string): Promise<void> {
@@ -272,4 +260,4 @@ if (require.main === module) {
}
new QuixoticBot(token, webAppUrl);
}
}