通知渠道增加Discord

This commit is contained in:
HankunYu
2025-12-22 02:11:09 +00:00
parent 51aad628b5
commit 355563244c
7 changed files with 85 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -49,6 +49,7 @@ const notificationTypeNames: { [key: string]: string } = {
vocechat: t('notification.vocechat.name'),
synologychat: t('notification.synologychat.name'),
slack: t('notification.slack.name'),
discord: t('notification.discord.name'),
webpush: t('notification.webpush.name'),
custom: t('setting.notification.custom'),
}
@@ -102,6 +103,8 @@ const getIcon = computed(() => {
return getLogoUrl('synologychat')
case 'slack':
return getLogoUrl('slack')
case 'discord':
return getLogoUrl('discord')
case 'webpush':
return getLogoUrl('chrome')
default:
@@ -350,6 +353,47 @@ function onClose() {
/>
</VCol>
</VRow>
<VRow v-else-if="notificationInfo.type == 'discord'">
<VCol cols="12" md="6">
<VTextField
v-model="notificationInfo.name"
:label="t('notification.name')"
:placeholder="t('notification.name')"
:hint="t('notification.nameHint')"
persistent-hint
prepend-inner-icon="mdi-label"
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="notificationInfo.config.DISCORD_WEBHOOK_URL"
:label="t('notification.discord.webhookUrl')"
:hint="t('notification.discord.webhookUrlHint')"
persistent-hint
prepend-inner-icon="mdi-webhook"
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="notificationInfo.config.DISCORD_USERNAME"
:label="t('notification.discord.username')"
:placeholder="t('notification.discord.usernamePlaceholder')"
:hint="t('notification.discord.usernameHint')"
persistent-hint
prepend-inner-icon="mdi-account"
/>
</VCol>
<VCol cols="12" md="6">
<VTextField
v-model="notificationInfo.config.DISCORD_AVATAR_URL"
:label="t('notification.discord.avatarUrl')"
:placeholder="t('notification.discord.avatarUrlPlaceholder')"
:hint="t('notification.discord.avatarUrlHint')"
persistent-hint
prepend-inner-icon="mdi-image-outline"
/>
</VCol>
</VRow>
<VRow v-else-if="notificationInfo.type == 'synologychat'">
<VCol cols="12" md="6">
<VTextField

View File

@@ -458,6 +458,18 @@ export default {
channelHint: 'Channel to send messages, default is "all"',
channelRequired: 'Channel Name cannot be empty',
},
discord: {
name: 'Discord',
webhookUrl: 'Webhook URL',
webhookUrlHint: 'Discord Webhook URL, format: https://discord.com/api/webhooks/...',
webhookUrlRequired: 'Webhook URL is required',
username: 'Username',
usernameHint: 'Custom username for webhook messages (optional)',
usernamePlaceholder: 'MoviePilot',
avatarUrl: 'Avatar URL',
avatarUrlHint: 'Custom avatar image URL (optional)',
avatarUrlPlaceholder: 'https://example.com/avatar.png',
},
synologychat: {
name: 'Synology Chat',
webhook: 'Webhook URL',

View File

@@ -456,6 +456,18 @@ export default {
channelHint: '消息发送频道,默认`全体`',
channelRequired: '频道名称不能为空',
},
discord: {
name: 'Discord',
webhookUrl: 'Webhook URL',
webhookUrlHint: 'Discord Webhook URL格式https://discord.com/api/webhooks/...',
webhookUrlRequired: 'Webhook URL不能为空',
username: '用户名',
usernameHint: '自定义消息显示的用户名(可选)',
usernamePlaceholder: 'MoviePilot',
avatarUrl: '头像URL',
avatarUrlHint: '自定义头像图片URL可选',
avatarUrlPlaceholder: 'https://example.com/avatar.png',
},
synologychat: {
name: 'Synology Chat',
webhook: '机器人传入URL',

View File

@@ -447,6 +447,18 @@ export default {
channel: '頻道名稱',
channelHint: '消息發送頻道,默認`全體`',
},
discord: {
name: 'Discord',
webhookUrl: 'Webhook URL',
webhookUrlHint: 'Discord Webhook URL格式https://discord.com/api/webhooks/...',
webhookUrlRequired: 'Webhook URL不能為空',
username: '用戶名',
usernameHint: '自定義消息顯示的用戶名(可選)',
usernamePlaceholder: 'MoviePilot',
avatarUrl: '頭像URL',
avatarUrlHint: '自定義頭像圖片URL可選',
avatarUrlPlaceholder: 'https://example.com/avatar.png',
},
synologychat: {
name: 'Synology Chat',
webhook: '機器人傳入URL',

View File

@@ -13,6 +13,7 @@ import trimemediaLogo from '@/assets/images/logos/trimemedia.png'
import wechatLogo from '@/assets/images/logos/wechat.png'
import telegramLogo from '@/assets/images/logos/telegram.webp'
import slackLogo from '@/assets/images/logos/slack.webp'
import discordLogo from '@/assets/images/logos/discord.png'
import synologychatLogo from '@/assets/images/logos/synologychat.png'
import vocechatLogo from '@/assets/images/logos/vocechat.png'
import downloaderLogo from '@/assets/images/logos/downloader.png'
@@ -40,6 +41,7 @@ const logoMap: Record<string, string> = {
wechat: wechatLogo,
telegram: telegramLogo,
slack: slackLogo,
discord: discordLogo,
synologychat: synologychatLogo,
vocechat: vocechatLogo,
downloader: downloaderLogo,

View File

@@ -294,6 +294,9 @@ onMounted(() => {
<VListItem @click="addNotification('slack')">
<VListItemTitle>{{ t('setting.notification.slack') }}</VListItemTitle>
</VListItem>
<VListItem @click="addNotification('discord')">
<VListItemTitle>Discord</VListItemTitle>
</VListItem>
<VListItem @click="addNotification('synologychat')">
<VListItemTitle>{{ t('setting.notification.synologyChat') }}</VListItemTitle>
</VListItem>