mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 23:38:32 +00:00
Fixed notification
This commit is contained in:
parent
76d7ff03e8
commit
4fa67ca35e
1 changed files with 5 additions and 6 deletions
|
@ -1,7 +1,6 @@
|
|||
import { NavContextMenuPatchCallback, addContextMenuPatch, removeContextMenuPatch } from "@api/ContextMenu";
|
||||
import { showNotification } from "@api/Notifications";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { DataStore } from "@api/index";
|
||||
import { DataStore, Notifications } from "@api/index";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { ChannelStore, Menu, PrivateChannelsStore, UserStore } from "@webpack/common";
|
||||
|
@ -123,18 +122,18 @@ export default definePlugin({
|
|||
|
||||
const { guilds, channels, users } = bypasses;
|
||||
if ((guilds.includes(guildId) || channels.includes(channelId)) && (message.content.includes(`<@${UserStore.getCurrentUser().id}>`) || message.mentions.some(mention => mention.id === UserStore.getCurrentUser().id))) {
|
||||
await showNotification({
|
||||
await Notifications.showNotification({
|
||||
title: `${message.author.username} sent a message in ${ChannelStore.getChannel(channelId).name}`,
|
||||
body: message.content,
|
||||
onClick: () => window.location.href = `https://discord.com/channels/${guildId}/${channelId}/${message.id}`
|
||||
icon: UserStore.getUser(message.author.id).getAvatarURL(undefined, undefined, false),
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (users.includes(message.author.id) && channelId === await PrivateChannelsStore.getOrEnsurePrivateChannel(message.author.id)) {
|
||||
await showNotification({
|
||||
await Notifications.showNotification({
|
||||
title: `${message.author.username} sent a message in a DM`,
|
||||
body: message.content,
|
||||
onClick: () => window.location.href = `https://discord.com/channels/@me/${channelId}/${message.id}`
|
||||
icon: UserStore.getUser(message.author.id).getAvatarURL(undefined, undefined, false),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue