Skip to content

Commit b3b2537

Browse files
authored
Merge pull request #4 from itsaschoolbus/master
Optional stickers
2 parents 011d657 + 88113f0 commit b3b2537

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ Before using this script, ensure you have the following dependencies installed:
4040
- `CONFIG_CHATID`: Your Telegram channel/group chat ID.
4141
- `CONFIG_BOT_TOKEN`: Your Telegram bot token.
4242
- `CONFIG_ERROR_CHATID`: (Optional) A separate chat ID for error logs.
43+
- `CONFIG_SEND_STICKER`: Whether the bot should send stickers to Telegram.
44+
- `CONFIG_STICKER_URL`: The link to the sticker image.
4345
- `CONFIG_PDUP_API`: Your PixelDrain API key.
46+
- `CONFIG_GOFILE`: Whether to upload the zip to Gofile.
4447
- `POWEROFF`: Set to `true` to power off the server after the build is complete.
4548

4649
## Usage

ci_bot.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ ROOT_DIRECTORY="$(pwd)"
3333
ROM_NAME="$(sed "s#.*/##" <<<"$(pwd)")"
3434
ANDROID_VERSION=$(grep -oP '(?<=android-)[0-9]+' .repo/manifests/default.xml | head -n1 || echo "N/A")
3535
OUT_DIR="$ROOT_DIRECTORY/out/target/product/$DEVICE"
36-
STICKER_URL="https://raw.githubusercontent.com/Weebo354342432/reimagined-enigma/main/update.webp"
3736

3837
# --- Helper Functions ---
3938

@@ -161,6 +160,7 @@ upload_file_pd() {
161160
fi
162161
}
163162

163+
# Function to upload a file to Gofile
164164
upload_file_gofile() {
165165
FILE_UPLOAD_PATH="$1"
166166
GOFILE_SERVER=$(curl -s https://api.gofile.io/servers | grep -oP '"name":"\K[^"]+' | head -n 1)
@@ -299,7 +299,9 @@ breakfast "$DEVICE"
299299
if [ $? -ne 0 ]; then
300300
build_failed_message=$(generate_telegram_message "🔴" "ROM compilation failed" "" "Failed at running breakfast for $DEVICE.")
301301
edit_message "$build_failed_message" "$CONFIG_CHATID" "$build_message_id"
302-
send_sticker "$STICKER_URL" "$CONFIG_CHATID"
302+
if [[ "$CONFIG_SEND_STICKER" == "true" ]]; then
303+
send_sticker "$CONFIG_STICKER_URL" "$CONFIG_CHATID"
304+
fi
303305
exit 1
304306
fi
305307

@@ -345,9 +347,11 @@ if ! grep -q "#### build completed successfully" "$ROOT_DIRECTORY/build.log"; th
345347
echo "out/error.log not found, sending full build.log instead."
346348
send_file "$ROOT_DIRECTORY/build.log" "$CONFIG_ERROR_CHATID"
347349
fi
348-
349-
send_sticker "$STICKER_URL" "$CONFIG_CHATID"
350-
350+
351+
if [[ "$CONFIG_SEND_STICKER" == "true" ]]; then
352+
send_sticker "$CONFIG_STICKER_URL" "$CONFIG_CHATID"
353+
fi
354+
351355
# Display the error log in the terminal
352356
if [ -f "out/error.log" ]; then
353357
echo -e "\n${RED}Displaying error log:${RESET}"
@@ -398,7 +402,9 @@ else
398402
build_finished_message=$(generate_telegram_message "🟢" "ROM compiled successfully!" "$details" "Compilation took $build_duration.")
399403

400404
edit_message "$build_finished_message" "$CONFIG_CHATID" "$build_message_id"
401-
send_sticker "$STICKER_URL" "$CONFIG_CHATID"
405+
if [[ "$CONFIG_SEND_STICKER" == "true" ]]; then
406+
send_sticker "$CONFIG_STICKER_URL" "$CONFIG_CHATID"
407+
fi
402408
fi
403409

404410
if [[ "$POWEROFF" == "true" ]]; then

config.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ CONFIG_OFFICIAL_FLAG=""
77
CONFIG_CHATID=""
88
CONFIG_BOT_TOKEN=""
99
CONFIG_ERROR_CHATID="" # Optional: If not set, errors are sent to CONFIG_CHATID
10+
CONFIG_SEND_STICKER="true"
11+
CONFIG_STICKER_URL="https://raw.githubusercontent.com/Weebo354342432/reimagined-enigma/main/update.webp"
1012

1113
# PixelDrain API Key
1214
CONFIG_PDUP_API=""

0 commit comments

Comments
 (0)