Browse Source

Update discord.sh

pull/2924/head
neil 3 years ago
committed by GitHub
parent
commit
451b290b79
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      notify/discord.sh

8
notify/discord.sh

@ -23,12 +23,12 @@ discord_send() {
_saveaccountconf_mutable DISCORD_WEBHOOK_URL "$DISCORD_WEBHOOK_URL" _saveaccountconf_mutable DISCORD_WEBHOOK_URL "$DISCORD_WEBHOOK_URL"
DISCORD_USERNAME="${DISCORD_USERNAME:-$(_readaccountconf_mutable DISCORD_USERNAME)}" DISCORD_USERNAME="${DISCORD_USERNAME:-$(_readaccountconf_mutable DISCORD_USERNAME)}"
if [ -n "$DISCORD_USERNAME" ]; then
if [ "$DISCORD_USERNAME" ]; then
_saveaccountconf_mutable DISCORD_USERNAME "$DISCORD_USERNAME" _saveaccountconf_mutable DISCORD_USERNAME "$DISCORD_USERNAME"
fi fi
DISCORD_AVATAR_URL="${DISCORD_AVATAR_URL:-$(_readaccountconf_mutable DISCORD_AVATAR_URL)}" DISCORD_AVATAR_URL="${DISCORD_AVATAR_URL:-$(_readaccountconf_mutable DISCORD_AVATAR_URL)}"
if [ -n "$DISCORD_AVATAR_URL" ]; then
if [ "$DISCORD_AVATAR_URL" ]; then
_saveaccountconf_mutable DISCORD_AVATAR_URL "$DISCORD_AVATAR_URL" _saveaccountconf_mutable DISCORD_AVATAR_URL "$DISCORD_AVATAR_URL"
fi fi
@ -36,10 +36,10 @@ discord_send() {
_content="$(printf "**%s**\n%s" "$_subject" "$_content" | _json_encode)" _content="$(printf "**%s**\n%s" "$_subject" "$_content" | _json_encode)"
_data="{\"content\": \"$_content\" " _data="{\"content\": \"$_content\" "
if [ -n "$DISCORD_USERNAME" ]; then
if [ "$DISCORD_USERNAME" ]; then
_data="$_data, \"username\": \"$DISCORD_USERNAME\" " _data="$_data, \"username\": \"$DISCORD_USERNAME\" "
fi fi
if [ -n "$DISCORD_AVATAR_URL" ]; then
if [ "$DISCORD_AVATAR_URL" ]; then
_data="$_data, \"avatar_url\": \"$DISCORD_AVATAR_URL\" " _data="$_data, \"avatar_url\": \"$DISCORD_AVATAR_URL\" "
fi fi
_data="$_data}" _data="$_data}"

Loading…
Cancel
Save