diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index 300d3c77d9..ec6c8a2e9b 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -571,7 +571,7 @@ module.exports = (_ => { BDFDB.LogUtils.log(BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_started", ""), plugin); if (Internal.settings.general.showToasts && !BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.showToasts)) BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_started", `${plugin.name} v${plugin.version}`), { disableInteractions: true, - barColor: BDFDB.DiscordConstants.Colors && BDFDB.DiscordConstants.Colors.STATUS_GREEN + barColor: BDFDB.DiscordConstants.Colors.STATUS_GREEN }); if (plugin.css) BDFDB.DOMUtils.appendLocalStyle(plugin.name, plugin.css); @@ -588,7 +588,7 @@ module.exports = (_ => { BDFDB.LogUtils.log(BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_stopped", ""), plugin); if (Internal.settings.general.showToasts && !BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.showToasts)) BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_stopped", `${plugin.name} v${plugin.version}`), { disableInteractions: true, - barColor: BDFDB.DiscordConstants.Colors && BDFDB.DiscordConstants.Colors.STATUS_RED + barColor: BDFDB.DiscordConstants.Colors.STATUS_RED }); const url = Internal.getPluginURL(plugin); @@ -3168,7 +3168,7 @@ module.exports = (_ => { BDFDB.MessageUtils = {}; BDFDB.MessageUtils.isSystemMessage = function (message) { - return message && message.type !== BDFDB.DiscordConstants.MessageTypes.DEFAULT && message.type !== BDFDB.DiscordConstants.MessageTypes.REPLY && (message.type !== BDFDB.DiscordConstants.MessageTypes.CHAT_INPUT_COMMAND || message.interaction == null); + return message && !BDFDB.DiscordConstants.MessageTypeGroups.USER_MESSAGE.has(message.type) && (message.type !== BDFDB.DiscordConstants.MessageTypes.CHAT_INPUT_COMMAND || message.interaction == null); }; BDFDB.MessageUtils.rerenderAll = function (instant) { BDFDB.TimeUtils.clear(BDFDB.MessageUtils.rerenderAll.timeout); @@ -4904,9 +4904,9 @@ module.exports = (_ => { render() { if (this.state.hasError) return Internal.LibraryModules.React.createElement("span", { style: { - background: BDFDB.DiscordConstants && BDFDB.DiscordConstants.Colors && BDFDB.DiscordConstants.Colors.PRIMARY_DARK, + background: BDFDB.DiscordConstants.Colors.PRIMARY_DARK, borderRadius: 5, - color: BDFDB.DiscordConstants && BDFDB.DiscordConstants.Colors && BDFDB.DiscordConstants.Colors.STATUS_RED, + color: BDFDB.DiscordConstants.Colors.STATUS_RED, fontSize: 12, fontWeight: 600, padding: 6, @@ -7690,8 +7690,8 @@ module.exports = (_ => { }; Internal.setDefaultProps(CustomComponents.Switch, { size: CustomComponents.Switch.Sizes.DEFAULT, - uncheckedColor: BDFDB.DiscordConstants.Colors && BDFDB.DiscordConstants.Colors.PRIMARY_DARK_400, - checkedColor: BDFDB.DiscordConstants.Colors && BDFDB.DiscordConstants.Colors.BRAND + uncheckedColor: BDFDB.DiscordConstants.Colors.PRIMARY_DARK_400, + checkedColor: BDFDB.DiscordConstants.Colors.BRAND }); CustomComponents.TabBar = reactInitialized && class BDFDB_TabBar extends Internal.LibraryModules.React.Component { diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index a200e7be4b..e80497bab1 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -900,7 +900,7 @@ module.exports = (_ => { processMessageContent (e) { if (e.instance.props.message && this.settings.places.chatWindow && this.shouldChangeInChat(e.instance.props.message.channel_id)) { if (!e.returnvalue) { - if (e.instance.props.message.type != BDFDB.DiscordConstants.MessageTypes.DEFAULT && e.instance.props.message.type != BDFDB.DiscordConstants.MessageTypes.REPLY) { + if (!BDFDB.DiscordConstants.MessageTypeGroups.USER_MESSAGE.has(message.type)) { let message = new BDFDB.DiscordObjects.Message(Object.assign({}, e.instance.props.message, {author: this.getUserData(e.instance.props.message.author.id, true, false, e.instance.props.message.author)})); let data = changedUsers[e.instance.props.message.author.id]; if (data) { diff --git a/Plugins/MessageUtilities/MessageUtilities.plugin.js b/Plugins/MessageUtilities/MessageUtilities.plugin.js index f7f61807ea..cb0db85747 100644 --- a/Plugins/MessageUtilities/MessageUtilities.plugin.js +++ b/Plugins/MessageUtilities/MessageUtilities.plugin.js @@ -355,7 +355,7 @@ module.exports = (_ => { doDelete ({messageDiv, message}, action, event) { let deleteLink = messageDiv.parentElement.querySelector(BDFDB.dotCNS.messagelocalbotoperations + BDFDB.dotCN.anchor); if (deleteLink) deleteLink.click(); - else if (BDFDB.DiscordConstants.MessageTypesDeletable[message.type]) { + else if (BDFDB.DiscordConstants.MessageTypeGroups.DELETABLE.has(message.type)) { let channel = BDFDB.LibraryModules.ChannelStore.getChannel(message.channel_id); if (channel && (BDFDB.UserUtils.can("MANAGE_MESSAGES") || message.author.id == BDFDB.UserUtils.me.id)) { BDFDB.LibraryModules.MessageUtils.deleteMessage(message.channel_id, message.id, message.state != BDFDB.DiscordConstants.MessageStates.SENT); @@ -382,7 +382,7 @@ module.exports = (_ => { doPinUnPin ({messageDiv, message}, action, event) { if (message.state == BDFDB.DiscordConstants.MessageStates.SENT) { let channel = BDFDB.LibraryModules.ChannelStore.getChannel(message.channel_id); - if (channel && (BDFDB.DMUtils.isDMChannel(channel.id) || BDFDB.UserUtils.can("MANAGE_MESSAGES")) && (message.type == BDFDB.DiscordConstants.MessageTypes.DEFAULT || message.type == BDFDB.DiscordConstants.MessageTypes.REPLY)) { + if (channel && (BDFDB.DMUtils.isDMChannel(channel.id) || BDFDB.UserUtils.can("MANAGE_MESSAGES")) && BDFDB.DiscordConstants.MessageTypeGroups.USER_MESSAGE.has(message.type)) { if (message.pinned) { BDFDB.LibraryModules.MessagePinUtils.unpinMessage(channel, message.id); if (this.settings.toasts[action]) BDFDB.NotificationUtils.toast(this.formatToast(BDFDB.LanguageUtils.LanguageStrings.MESSAGE_UNPINNED), {type: "danger"}); @@ -398,7 +398,7 @@ module.exports = (_ => { doReply ({messageDiv, message}, action, event) { if (message.state == BDFDB.DiscordConstants.MessageStates.SENT) { let channel = BDFDB.LibraryModules.ChannelStore.getChannel(message.channel_id); - if (channel && (BDFDB.DMUtils.isDMChannel(channel.id) || BDFDB.UserUtils.can("SEND_MESSAGES")) && (message.type == BDFDB.DiscordConstants.MessageTypes.DEFAULT || message.type == BDFDB.DiscordConstants.MessageTypes.REPLY)) { + if (channel && (BDFDB.DMUtils.isDMChannel(channel.id) || BDFDB.UserUtils.can("SEND_MESSAGES")) && BDFDB.DiscordConstants.MessageTypeGroups.USER_MESSAGE.has(message.type)) { BDFDB.LibraryModules.MessageManageUtils.replyToMessage(channel, message, {}); if (this.settings.toasts[action]) BDFDB.NotificationUtils.toast(this.formatToast(BDFDB.LanguageUtils.LanguageStrings.NOTIFICATION_REPLY), {type: "success"}); } diff --git a/Plugins/RemoveBlockedUsers/RemoveBlockedUsers.plugin.js b/Plugins/RemoveBlockedUsers/RemoveBlockedUsers.plugin.js index 22a0274c17..9a0c4b72c0 100644 --- a/Plugins/RemoveBlockedUsers/RemoveBlockedUsers.plugin.js +++ b/Plugins/RemoveBlockedUsers/RemoveBlockedUsers.plugin.js @@ -260,7 +260,7 @@ module.exports = (_ => { } let groupId, author; for (let i in newStream) { - if (newStream[i].type == "MESSAGE" && (newStream[i].content.type.type == BDFDB.DiscordConstants.MessageTypes.DEFAULT || newStream[i].content.type.type == BDFDB.DiscordConstants.MessageTypes.REPLY) && groupId != newStream[i].groupId) { + if (newStream[i].type == "MESSAGE" && BDFDB.DiscordConstants.MessageTypeGroups.USER_MESSAGE.has(newStream[i].content.type) && groupId != newStream[i].groupId) { if (author && author.id == newStream[i].content.author.id && author.username == newStream[i].content.author.username) newStream[i] = Object.assign({}, newStream[i], {groupId: groupId}); author = newStream[i].content.author; }