This repository has been archived by the owner on Jun 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
telegram
116 lines (101 loc) · 2.97 KB
/
telegram
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/env dash
# shellcheck source=/dev/null
#
# Copyright (C) 2018 Raphielscape LLC.
#
# Licensed under the Raphielscape Public License, Version 1.0 (the "License");
# you may not use this file except in compliance with the License.
#
# Telegram command container
if [ "$(hostname)" == "Android-A320FL-Build-Box" ]; then
TELEGRAM=/home/McFy/baalajimaestro/Blobs/auto-blob-updater/telegramapi
chmod +x /home/McFy/baalajimaestro/Blobs/auto-blob-updater/telegramapi
else
TELEGRAM=/drone/src/telegramapi
fi
export TELEGRAM
# Caster configurations
MAINGROUP_ID="-1001427544283"
BUILDSCAPERER_ID="-1001192834712"
DEBUG_ID="-1001200493978"
# Graphics Interchange Format Assets
Start_Asset="CAADBAADHwEAArznMw8iLJLuDeQskAI"
Stop_Asset="https://i.imgur.com/Q6nllGX.gif"
Jump_Asset="https://media.giphy.com/media/l41lI4bYmcsPJX9Go/giphy.gif"
# GIF Stuff
tg_build_sendsticker() {
curl -s -X POST "https://api.telegram.org/bot$BOT_API_KEY/SendSticker" \
-d sticker="${Start_Asset}" \
-d chat_id=${BUILDSCAPERER_ID} >> /dev/null
}
tg_buildmain_sendgif() {
curl -s -X POST "https://api.telegram.org/bot$BOT_API_KEY/SendAnimation" \
-d animation="${Jump_Asset}" \
-d chat_id=${MAINGROUP_ID} >> /dev/null
}
# Interruption Happen, report with GIF
tg_intgif() {
curl -s -X POST "https://api.telegram.org/bot$BOT_API_KEY/SendAnimation" \
-d animation="${Stop_Asset}" \
-d chat_id=${BUILDSCAPERER_ID} >> /dev/null
}
tg_intgifmain() {
curl -s -X POST "https://api.telegram.org/bot$BOT_API_KEY/SendAnimation" \
-d animation="${Stop_Asset}" \
-d chat_id=${MAINGROUP_ID} >> /dev/ -t null
}
# Push to Channel
push() {
"${TELEGRAM}" -f "Retarded-Nightly.zip" \
-c ${BUILDSCAPERER_ID} -t $BOT_API_KEY
}
# sendcast to group
tg_sendinfo() {
"${TELEGRAM}" -c ${MAINGROUP_ID} -H \
"$(
for POST in "${@}"; do
echo "${POST}"
done
)" \
-t $BOT_API_KEY
}
# sendcast to channel
tg_channelcast() {
"${TELEGRAM}" -c ${BUILDSCAPERER_ID} -H \
"$(
for POST in "${@}"; do
echo "${POST}"
done
)" \
-t $BOT_API_KEY
}
# Debugcasting
tg_debugcast() {
"${TELEGRAM}" -c ${DEBUG_ID} -H \
"$(
for POST in "${@}"; do
echo "${POST}"
done
)" \
-t $BOT_API_KEY
}
kickstart_pub() {
tg_sendinfo "I am starting build" \
"Branch <code>${PARSE_BRANCH}</code>" \
"Commit Point <code>${COMMIT_POINT}</code>" \
" " \
"<b>Github Link: </b> https://github.com/raphielgang/telegram-userbot/commit/${COMMIT_HASH}" \
" " \
"<b>CI Link: </b> https://semaphoreci.com/baalajimaestro/telegram-userbot"
}
kickstart_priv() {
tg_buildmain_sendgif
tg_debugcast "Compiler <code>${COMPILER_USED}</code>" \
"Device <b>${DEVICE}</b>" \
"Branch <code>${PARSE_BRANCH}</code>" \
"Commit Point <code>${COMMIT_POINT}</code>" \
"Under <code>$(hostname)</code>" \
"Started on <code>$(whoami)</code>"
tg_debugcast "This ${COMPILER_USED} build will not producing any binaries" \
"This is internal build"
}