add more argument to do more

This commit is contained in:
2018-05-07 23:37:11 +08:00
parent df6d16ff97
commit 393f6de8b1

6
bot.sh
View File

@ -5,17 +5,17 @@ user=$2
# 傳送訊息
function sendMessage {
curl "https://api.telegram.org/bot$token/sendMessage?chat_id=$user&text=$1"
curl "https://api.telegram.org/bot$token/sendMessage?chat_id=$user&text=$1$2"
}
# 傳送照片
function sendPhoto {
curl "https://api.telegram.org/bot$token/sendPhoto?chat_id=$user&photo=$1&caption=$2"
curl "https://api.telegram.org/bot$token/sendPhoto?chat_id=$user&photo=$1&caption=$2$3"
}
# 傳送貼圖
function sendSticker {
curl "https://api.telegram.org/bot$token/sendSticker?chat_id=$user&sticker=$1"
curl "https://api.telegram.org/bot$token/sendSticker?chat_id=$user&sticker=$1$2"
}
# 主程式