Update FriendNotifications.plugin.js

This commit is contained in:
Mirco Wittrien 2024-07-07 10:10:49 +02:00
parent bef94dc346
commit 6cee1866cd
1 changed files with 22 additions and 5 deletions

View File

@ -214,6 +214,9 @@ module.exports = (_ => {
muteOnDND: {value: false, description: "Does not notify you when you are in DnD Status"}, muteOnDND: {value: false, description: "Does not notify you when you are in DnD Status"},
openOnClick: {value: false, description: "Opens the DM when you click a Notification"} openOnClick: {value: false, description: "Opens the DM when you click a Notification"}
}, },
choices: {
toastPosition: {value: "right", description: "Position of Toast Notifications", items: "ToastPositions"}
},
notificationStrings: { notificationStrings: {
online: {value: "$user changed status to '$status'"}, online: {value: "$user changed status to '$status'"},
idle: {value: "$user changed status to '$status'"}, idle: {value: "$user changed status to '$status'"},
@ -505,6 +508,19 @@ module.exports = (_ => {
label: this.defaults.general[key].description, label: this.defaults.general[key].description,
value: this.settings.general[key] value: this.settings.general[key]
})), })),
Object.keys(this.defaults.choices).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
type: "Select",
plugin: this,
keys: ["choices", key],
label: this.defaults.choices[key].description,
basis: "50%",
value: this.settings.choices[key],
options: Object.keys(BDFDB.DiscordConstants[this.defaults.choices[key].items] || {}).map(p => ({
value: p,
label: BDFDB.LanguageUtils.LibraryStrings[p] || p
})),
searchable: true
})),
Object.keys(this.defaults.dates).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.DateInput, { Object.keys(this.defaults.dates).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.DateInput, {
...(this.settings.dates[key] || {}), ...(this.settings.dates[key] || {}),
label: this.defaults.dates[key].description, label: this.defaults.dates[key].description,
@ -913,6 +929,7 @@ module.exports = (_ => {
timeout: this.settings.amounts.toastTime * 1000, timeout: this.settings.amounts.toastTime * 1000,
avatar: avatar, avatar: avatar,
barColor: BDFDB.UserUtils.getStatusColor(status.name, true), barColor: BDFDB.UserUtils.getStatusColor(status.name, true),
position: this.settings.choices.toastPosition,
onClick: openChannel, onClick: openChannel,
onShow: _ => { onShow: _ => {
let notificationSound = this.settings.notificationSounds["toast" + status.name] || {}; let notificationSound = this.settings.notificationSounds["toast" + status.name] || {};