diff --git a/src/equicordplugins/toastNotifications/index.tsx b/src/equicordplugins/toastNotifications/index.tsx index 7cf4e4ab8..caacca69d 100644 --- a/src/equicordplugins/toastNotifications/index.tsx +++ b/src/equicordplugins/toastNotifications/index.tsx @@ -22,7 +22,7 @@ import definePlugin, { makeRange, OptionType } from "@utils/types"; import { Channel, Message, User } from "@vencord/discord-types"; import { MessageType, RelationshipType } from "@vencord/discord-types/enums"; import { findByPropsLazy, findStore } from "@webpack"; -import { Button, ChannelStore, GuildRoleStore, NavigationRouter, RelationshipStore, SelectedChannelStore, StreamerModeStore, UserStore } from "@webpack/common"; +import { Button, ChannelStore, GuildRoleStore, IconUtils, NavigationRouter, RelationshipStore, SelectedChannelStore, StreamerModeStore, UserStore } from "@webpack/common"; import { ReactNode } from "react"; import { NotificationData, showNotification } from "./components/Notifications"; @@ -243,7 +243,7 @@ export default definePlugin({ // Prepare the notification. const Notification: NotificationData = { title: getName(message.author), - icon: `https://cdn.discordapp.com/avatars/${message.author.id}/${message.author.avatar}.png?size=128`, + icon: IconUtils.getUserAvatarURL(message.author), body: message.content, attachments: message.attachments?.length, richBody: null, @@ -453,7 +453,7 @@ async function handleGuildMessage(message: Message) { // Prepare the notification. const Notification: NotificationData = { title: `${getName(message.author)} (#${channel.name})`, - icon: `https://cdn.discordapp.com/avatars/${message.author.id}/${message.author.avatar}.png?size=128`, + icon: IconUtils.getUserAvatarURL(message.author), body: message.content, attachments: message.attachments?.length, richBody: null, @@ -538,7 +538,7 @@ async function relationshipAdd(user: User, type: Number) { const Notification: NotificationData = { title: "", - icon: user.getAvatarURL(), + icon: IconUtils.getUserAvatarURL(user), body: "", attachments: 0, }; @@ -567,7 +567,7 @@ async function relationshipAdd(user: User, type: Number) { function showExampleNotification(): Promise { const Notification: NotificationData = { title: "Example Notification", - icon: `https://cdn.discordapp.com/avatars/${UserStore.getCurrentUser().id}/${UserStore.getCurrentUser().avatar}.png?size=128`, + icon: IconUtils.getUserAvatarURL(UserStore.getCurrentUser()), body: "This is an example toast notification!", attachments: 0, permanent: false diff --git a/src/plugins/newGuildSettings/index.tsx b/src/plugins/newGuildSettings/index.tsx index 747d65286..ca00e5bc6 100644 --- a/src/plugins/newGuildSettings/index.tsx +++ b/src/plugins/newGuildSettings/index.tsx @@ -162,7 +162,7 @@ export default definePlugin({ { find: ",acceptInvite(", replacement: { - match: /INVITE_ACCEPT_SUCCESS.+?,(\i)=null!=.+?;/, + match: /INVITE_ACCEPT_SUCCESS.+?,(\i)=\i\?\.guild_id.+?;/, replace: (m, guildId) => `${m}$self.applyDefaultSettings(${guildId});` } },