Browse Source
Merge pull request #393 from Revyn112/master
add possibility to have a prefixMessage in discord notification before the embed
pull/401/head
Louis Lam
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
15 additions and
0 deletions
-
server/notification-providers/discord.js
-
src/components/NotificationDialog.vue
|
|
@ -62,6 +62,11 @@ class Discord extends NotificationProvider { |
|
|
|
], |
|
|
|
}], |
|
|
|
} |
|
|
|
|
|
|
|
if (notification.discordPrefixMessage) { |
|
|
|
discorddowndata.content = notification.discordPrefixMessage; |
|
|
|
} |
|
|
|
|
|
|
|
await axios.post(notification.discordWebhookUrl, discorddowndata) |
|
|
|
return okMsg; |
|
|
|
|
|
|
@ -92,6 +97,11 @@ class Discord extends NotificationProvider { |
|
|
|
], |
|
|
|
}], |
|
|
|
} |
|
|
|
|
|
|
|
if (notification.discordPrefixMessage) { |
|
|
|
discordupdata.content = notification.discordPrefixMessage; |
|
|
|
} |
|
|
|
|
|
|
|
await axios.post(notification.discordWebhookUrl, discordupdata) |
|
|
|
return okMsg; |
|
|
|
} |
|
|
|
|
|
@ -80,6 +80,11 @@ |
|
|
|
<label for="discord-username" class="form-label">Bot Display Name</label> |
|
|
|
<input id="discord-username" v-model="notification.discordUsername" type="text" class="form-control" autocomplete="false" :placeholder="$root.appName"> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="mb-3"> |
|
|
|
<label for="discord-prefix-message" class="form-label">Prefix Custom Message</label> |
|
|
|
<input id="discord-prefix-message" v-model="notification.discordPrefixMessage" type="text" class="form-control" autocomplete="false" placeholder="Hello @everyone is..."> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template v-if="notification.type === 'signal'"> |
|
|
|