Skip to content

Commit 88113f0

Browse files
committed
bot: Make sending stickers optional
1 parent 2ceb176 commit 88113f0

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ 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.
4446
- `CONFIG_GOFILE`: Whether to upload the zip to Gofile.
4547
- `POWEROFF`: Set to `true` to power off the server after the build is complete.

ci_bot.sh

Lines changed: 11 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

@@ -300,7 +299,9 @@ breakfast "$DEVICE"
300299
if [ $? -ne 0 ]; then
301300
build_failed_message=$(generate_telegram_message "🔴" "ROM compilation failed" "" "Failed at running breakfast for $DEVICE.")
302301
edit_message "$build_failed_message" "$CONFIG_CHATID" "$build_message_id"
303-
send_sticker "$STICKER_URL" "$CONFIG_CHATID"
302+
if [[ "$CONFIG_SEND_STICKER" == "true" ]]; then
303+
send_sticker "$CONFIG_STICKER_URL" "$CONFIG_CHATID"
304+
fi
304305
exit 1
305306
fi
306307

@@ -346,9 +347,11 @@ if ! grep -q "#### build completed successfully" "$ROOT_DIRECTORY/build.log"; th
346347
echo "out/error.log not found, sending full build.log instead."
347348
send_file "$ROOT_DIRECTORY/build.log" "$CONFIG_ERROR_CHATID"
348349
fi
349-
350-
send_sticker "$STICKER_URL" "$CONFIG_CHATID"
351-
350+
351+
if [[ "$CONFIG_SEND_STICKER" == "true" ]]; then
352+
send_sticker "$CONFIG_STICKER_URL" "$CONFIG_CHATID"
353+
fi
354+
352355
# Display the error log in the terminal
353356
if [ -f "out/error.log" ]; then
354357
echo -e "\n${RED}Displaying error log:${RESET}"
@@ -399,7 +402,9 @@ else
399402
build_finished_message=$(generate_telegram_message "🟢" "ROM compiled successfully!" "$details" "Compilation took $build_duration.")
400403

401404
edit_message "$build_finished_message" "$CONFIG_CHATID" "$build_message_id"
402-
send_sticker "$STICKER_URL" "$CONFIG_CHATID"
405+
if [[ "$CONFIG_SEND_STICKER" == "true" ]]; then
406+
send_sticker "$CONFIG_STICKER_URL" "$CONFIG_CHATID"
407+
fi
403408
fi
404409

405410
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)