Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix In App Notifications #397

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions InAppNotifications/InAppNotifications.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @source https://github.com/QWERTxD/BetterDiscordPlugins/blob/main/InAppNotifications/InAppNotifications.plugin.js
* @updateUrl https://raw.githubusercontent.com/QWERTxD/BetterDiscordPlugins/main/InAppNotifications/InAppNotifications.plugin.js
* @website https://github.com/QWERTxD/BetterDiscordPlugins/tree/main/InAppNotifications
* @version 1.1.4
* @version 1.1.5
*/
const request = require("request");
const fs = require("fs");
Expand All @@ -30,7 +30,7 @@ const config = {
"title": "Discriminators",
"type": "added",
"items": [
"Modified how usernames and display names are displayed in notifications.",
"Fixed for new discord update",
]
}
],
Expand Down Expand Up @@ -993,15 +993,17 @@ const config = {
message.guild_id || "@me"
);
if (MuteStore.allowAllMessages(channel)) return true;
const SomethingHereShrug = isMentioned.isRawMessageMentioned(
{
rawMessage: message,
userId: UserStore.getCurrentUser().id,
suppressEveryone,
suppressRoles
const currentUserId = UserStore.getCurrentUser().id;
const mentionedUsers = message.mentions.map(user => user.id);
const messageRoles = message.mention_roles;
let roleMentioned = false;
if (message.mention_roles) {
const currentUserRoles = GuildMemberStore.getSelfMember(message.guild_id).roles;
roleMentioned = (currentUserRoles.some(i => messageRoles.includes(i)));
}
);
return SomethingHereShrug
return mentionedUsers.includes(currentUserId) ||
(!suppressEveryone && message.mention_everyone) ||
(!suppressRoles && message.mention_roles.length > 0 && roleMentioned);
}

checkSettings(message, channel) {
Expand Down