diff --git a/src/equicordplugins/toastNotifications/index.tsx b/src/equicordplugins/toastNotifications/index.tsx index b6433cdf3..006be4dce 100644 --- a/src/equicordplugins/toastNotifications/index.tsx +++ b/src/equicordplugins/toastNotifications/index.tsx @@ -20,12 +20,13 @@ import { definePluginSettings } from "@api/Settings"; import { EquicordDevs } from "@utils/constants"; import definePlugin, { makeRange, OptionType } from "@utils/types"; import { Channel, Message, User } from "@vencord/discord-types"; +import { MessageType } from "@vencord/discord-types/enums"; import { findByPropsLazy, findStore } from "@webpack"; import { Button, ChannelStore, GuildRoleStore, NavigationRouter, RelationshipStore, SelectedChannelStore, StreamerModeStore, UserStore } from "@webpack/common"; import { ReactNode } from "react"; import { NotificationData, showNotification } from "./components/Notifications"; -import { MessageTypes, RelationshipType, StreamingTreatment } from "./types"; +import { RelationshipType, StreamingTreatment } from "./types"; let ignoredUsers: string[] = []; let notifyFor: string[] = []; @@ -271,11 +272,11 @@ export default definePlugin({ // Handle specific message types. switch (message.type) { - case MessageTypes.CALL: { + case MessageType.CALL: { Notification.body = "Started a call with you!"; break; } - case MessageTypes.CHANNEL_RECIPIENT_ADD: { + case MessageType.RECIPIENT_ADD: { const actor = UserStore.getUser(message.author.id); const user = message.mentions[0]; const targetUser = UserStore.getUser((user as any).id); @@ -283,7 +284,7 @@ export default definePlugin({ Notification.body = `${getName(targetUser)} was added to the group by ${getName(actor)}.`; break; } - case MessageTypes.CHANNEL_RECIPIENT_REMOVE: { + case MessageType.RECIPIENT_REMOVE: { const actor = UserStore.getUser(message.author.id); const user = message.mentions[0]; const targetUser = UserStore.getUser((user as any).id); @@ -295,15 +296,15 @@ export default definePlugin({ } break; } - case MessageTypes.CHANNEL_NAME_CHANGE: { + case MessageType.CHANNEL_NAME_CHANGE: { Notification.body = `Changed the channel name to '${message.content}'.`; break; } - case MessageTypes.CHANNEL_ICON_CHANGE: { + case MessageType.CHANNEL_ICON_CHANGE: { Notification.body = "Changed the channel icon."; break; } - case MessageTypes.CHANNEL_PINNED_MESSAGE: { + case MessageType.CHANNEL_PINNED_MESSAGE: { Notification.body = "Pinned a message."; break; } diff --git a/src/equicordplugins/toastNotifications/types.ts b/src/equicordplugins/toastNotifications/types.ts index d3c444f16..4959fe853 100644 --- a/src/equicordplugins/toastNotifications/types.ts +++ b/src/equicordplugins/toastNotifications/types.ts @@ -16,15 +16,6 @@ * along with this program. If not, see . */ -export const enum MessageTypes { - CHANNEL_RECIPIENT_ADD = 1, - CHANNEL_RECIPIENT_REMOVE = 2, - CALL = 3, - CHANNEL_NAME_CHANGE = 4, - CHANNEL_ICON_CHANGE = 5, - CHANNEL_PINNED_MESSAGE = 6, -} - export const enum RelationshipType { FRIEND = 1, BLOCKED = 2,