2016-06-19 00:56:20 +02:00
#!/bin/bash
# Edit your commands in this file.
# Licensed under gplv3
if [ " $1 " = "source" ] ; then
# Place the token in the token file
TOKEN = $( cat token)
# Set INLINE to 1 in order to receive inline queries.
# To enable this option in your bot, send the /setinline command to @BotFather.
INLINE = 0
# Set to .* to allow sending files from all locations
FILE_REGEX = '/home/user/allowed/.*'
else
send_action " ${ CHAT [ID] } " "typing"
if ! tmux ls | grep -v send | grep -q $copname ; then
[ ! -z ${ URLS [*] } ] && {
send_message " ${ CHAT [ID] } " "Initiating recognition process..."
curl -s ${ URLS [*] } -o /tmp/$ME $NAME
send_message " ${ CHAT [ID] } " " $( ../audiokeychain.sh " /tmp/ $ME $NAME " ) "
rm " /tmp/ $ME $NAME "
2016-06-19 01:25:43 +02:00
return
2016-06-19 00:56:20 +02:00
}
fi
case $MESSAGE in
'/info' )
send_markdown_message " ${ CHAT [ID] } " "This is bashbot, the *Telegram* bot written entirely in *bash*."
; ;
*)
2016-06-19 01:25:43 +02:00
send_message " ${ CHAT [ID] } " " This bot can recognize the musical key and the bpm (beats per minute) of any song.
2016-06-19 00:56:20 +02:00
To start, send me an audio file in mp3 or wav format smaller than 15 megabytes.
2016-06-19 01:25:43 +02:00
Available commands:
• /start: Start bot and get this message.
2016-06-19 00:56:20 +02:00
This bot uses audiokeychain.com to recognize the songs. Both the audiokeychain client and the bot is written by Daniil Gentili ( @danogentili) .
2016-06-19 01:25:43 +02:00
Check out my other bots: @video_dl_bot, @mklwp_bot, @caption_ai_bot, @cowsaysbot, @cowthinksbot, @figletsbot, @lolcatzbot, @filtersbot, @id3bot, @pwrtelegrambot
Source code: https://github.com/danog/audiokeychain-clients
2016-06-19 00:56:20 +02:00
"
; ;
esac
fi