-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupload.sh
More file actions
executable file
·46 lines (40 loc) · 829 Bytes
/
Copy pathupload.sh
File metadata and controls
executable file
·46 lines (40 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Script by Lau <laststandrighthere@gmail.com>
#
# Usage: [Group/Channel ID] [Bot Token] [Action] [Extra]
#
# Action -> Extra
# ---------------------
# msg -> text
# file -> filename
# sticker -> stickerid
#
if [ "$4" == "" ]; then
echo -e "Enter all the needed parameters"
exit 1
fi
CHANNEL_ID=$1
BOT_TOKEN=$2
ACTION=$3
EXTRA=$4
URL="https://api.telegram.org/bot${BOT_TOKEN}/"
case "$ACTION" in
msg)
curl \
-X POST ${URL}sendMessage \
-d chat_id=$CHANNEL_ID \
-d text=$EXTRA
;;
file)
curl \
-F chat_id=$CHANNEL_ID \
-F document=@$EXTRA ${URL}sendDocument
;;
sticker)
curl \
-X POST ${URL}sendSticker \
-d chat_id=$CHANNEL_ID \
-d sticker=$EXTRA
;;
esac
# End