tbl.sh 888 B

12345678910111213141516171819202122232425262728293031323334353637
  1. apiToken=yourbotToken
  2. # example:
  3. # apiToken=123456789:AbCdEfgijk1LmPQRSTu234v5Wx-yZA67BCD
  4. userChatId=userChatId
  5. # example:
  6. # userChatId=123456789
  7. send_t() {
  8. curl -s \
  9. -X POST \
  10. https://api.telegram.org/bot$apiToken/sendMessage \
  11. -d text="$1" \
  12. -d chat_id=$userChatId
  13. }
  14. r_telegram() {
  15. curl -s \
  16. -X POST \
  17. https://api.telegram.org/bot$apiToken/getUpdates
  18. }
  19. send_mp3() {
  20. curl -s -X POST "https://api.telegram.org/bot$apiToken/sendAudio" -F chat_id=$userChatId -F audio="@$1"
  21. }
  22. send_f() {
  23. curl -s -X POST "https://api.telegram.org/bot"$apiToken"/sendPhoto" -F chat_id=$userChatId -F photo="@$1"
  24. }
  25. send_v() {
  26. curl -s -X POST "https://api.telegram.org/bot"$apiToken"/sendVideo" -F chat_id=$userChatId -F video="@$1""
  27. }
  28. send_d() {
  29. curl -s -X POST "https://api.telegram.org/bot"$apiToken"/sendDocument" -F chat_id=$userChatId -F document="@$1"
  30. }