logs
This commit is contained in:
10
src/bot.ts
10
src/bot.ts
@@ -157,15 +157,23 @@ export class QuixoticBot {
|
||||
|
||||
// Handle web app data
|
||||
this.bot.on('web_app_data', async (msg: Message) => {
|
||||
console.log('🔍 Web app data received:', msg.web_app?.data);
|
||||
const chatId = msg.chat.id;
|
||||
|
||||
if (!msg.web_app?.data) return;
|
||||
if (!msg.web_app?.data) {
|
||||
console.log('❌ No web app data found');
|
||||
return;
|
||||
}
|
||||
|
||||
const data: WebAppData = JSON.parse(msg.web_app.data);
|
||||
console.log('📝 Parsed data:', data);
|
||||
|
||||
try {
|
||||
if (data.action === 'send_audio') {
|
||||
console.log('🎵 Sending audio file:', data.title);
|
||||
await this.sendAudioFile(chatId, data.audioUrl, data.title);
|
||||
} else {
|
||||
console.log('⚠️ Unknown action:', data.action);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Web app data error:', error);
|
||||
|
||||
Reference in New Issue
Block a user