@@ -562,20 +562,20 @@ send_notification() {
562
562
# Get a random joke from the specified file
563
563
# Check if the webhook is for discord
564
564
if [[ " $webhook " =~ ^https://discord\. com/api/webhooks/ ]]; then
565
- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
565
+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
566
566
discord_common_fields
567
567
bot_name=" Notification Bot"
568
568
# Call the discord_payload function to construct the payload
569
569
if [ ${# new_container[@]} -gt 0 ]; then
570
- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
570
+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
571
571
new_container_notification
572
572
new_container_response=$( curl -s -H " Content-Type: application/json" -X POST -d " $payload " " $webhook " )
573
573
if [ " $dry_run " == " true" ]; then
574
574
echo " $new_container_response "
575
575
fi
576
576
fi
577
577
if [ ${# removed_containers[@]} -gt 0 ]; then
578
- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
578
+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
579
579
removed_container_notification
580
580
removed_container=$( curl -s -H " Content-Type: application/json" -X POST -d " $payload " " $webhook " )
581
581
if [ " $dry_run " == " true" ]; then
@@ -594,19 +594,19 @@ send_notification() {
594
594
fi
595
595
# Check if the webhook is for notifiarr
596
596
if [[ $webhook =~ ^https://notifiarr\. com/api/v1/notification/passthrough ]]; then
597
- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
597
+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
598
598
notifiarr_common_fields
599
599
# Call the notifiarr_payload function to construct the payload
600
600
if [ ${# new_container[@]} -gt 0 ]; then
601
- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
601
+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
602
602
new_container_notification
603
603
new_container_response=$( curl -s -H " Content-Type: application/json" -X POST -d " $payload " " $webhook " )
604
604
if [ " $dry_run " == " true" ]; then
605
605
echo " $new_container_response "
606
606
fi
607
607
fi
608
608
if [ ${# removed_containers[@]} -gt 0 ]; then
609
- joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1)
609
+ joke=$( curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed ' s/"/\\"/g ' )
610
610
removed_container_notification
611
611
removed_container=$( curl -s -H " Content-Type: application/json" -X POST -d " $payload " " $webhook " )
612
612
if [ " $dry_run " == " true" ]; then
0 commit comments