ToastNotifications & NewGuildSettings: Fixes
This commit is contained in:
parent
fe51bc22a9
commit
c9d7bf2065
2 changed files with 6 additions and 6 deletions
|
|
@ -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<void> {
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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});`
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue