diff --git a/app.js b/app.js index b409d52..bed3814 100644 --- a/app.js +++ b/app.js @@ -92,5 +92,9 @@ bot.command('q', ctx => { answerQuestion(ctx.message.text.slice(+3), ctx, bot) }) +bot.command('sb' , ctx => { + bot.telegram.sendAudio(ctx.chat.id, "./src/audio/Spider-Bigard.mp3", {}) +}) + //bot launch bot.launch(); \ No newline at end of file diff --git a/libs/botTools.js b/libs/botTools.js index 45e5909..30cadc0 100644 --- a/libs/botTools.js +++ b/libs/botTools.js @@ -19,6 +19,8 @@ function image_search(query, ctx, bot) { }); console.log("--> sent the image for the query: " + query); addToLogs("--> sent the image for the query: " + query); + }).catch(err => { + console.log(err) }) } diff --git a/libs/dadJokes.js b/libs/dadJokes.js index 8352da2..19a2020 100644 --- a/libs/dadJokes.js +++ b/libs/dadJokes.js @@ -15,8 +15,12 @@ function getJoke(ctx, bot) { if (error) throw new Error(error); res = JSON.parse(body) + bot.telegram.sendMessage(ctx.chat.id, res.body[0].setup, {}); + + setTimeout(() => { bot.telegram.sendMessage(ctx.chat.id, res.body[0].punchline, {}); + }, 500); }); } diff --git a/src/audio/Spider-Bigard.mp3 b/src/audio/Spider-Bigard.mp3 new file mode 100644 index 0000000..85471ba Binary files /dev/null and b/src/audio/Spider-Bigard.mp3 differ