canary fix

This commit is contained in:
Mirco Wittrien 2022-08-01 22:55:52 +02:00
parent 838b77f9e6
commit 5a2d08b163
7 changed files with 22 additions and 72 deletions

View File

@ -2,7 +2,7 @@
* @name LastMessageDate
* @author DevilBro
* @authorId 278543574059057154
* @version 1.2.8
* @version 1.2.9
* @description Displays the Last Message Date of a Member for the current Server/DM in the UserPopout and UserModal
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,13 +17,8 @@ module.exports = (_ => {
"info": {
"name": "LastMessageDate",
"author": "DevilBro",
"version": "1.2.8",
"version": "1.2.9",
"description": "Displays the Last Message Date of a Member for the current Server/DM in the UserPopout and UserModal"
},
"changeLog": {
"fixed": {
"User Popout": "No Longer requires you to open the Popout twice"
}
}
};
@ -101,7 +96,7 @@ module.exports = (_ => {
onStart () {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.DispatchApiUtils, "dirtyDispatch", {after: e => {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == BDFDB.DiscordConstants.ActionTypes.MESSAGE_CREATE && e.methodArguments[0].message) {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == "MESSAGE_CREATE" && e.methodArguments[0].message) {
let message = e.methodArguments[0].message;
let guildId = message.guild_id || message.channel_id;
if (guildId && loadedUsers[guildId] && loadedUsers[guildId][message.author.id]) {

View File

@ -2,7 +2,7 @@
* @name NotificationSounds
* @author DevilBro
* @authorId 278543574059057154
* @version 3.7.0
* @version 3.7.1
* @description Allows you to replace the native Sounds with custom Sounds
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,7 +17,7 @@ module.exports = (_ => {
"info": {
"name": "NotificationSounds",
"author": "DevilBro",
"version": "3.7.0",
"version": "3.7.1",
"description": "Allows you to replace the native Sounds with custom Sounds"
}
};
@ -222,7 +222,7 @@ module.exports = (_ => {
}
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.DispatchApiUtils, "dirtyDispatch", {before: e => {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == BDFDB.DiscordConstants.ActionTypes.MESSAGE_CREATE && e.methodArguments[0].message) {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == "MESSAGE_CREATE" && e.methodArguments[0].message) {
const message = e.methodArguments[0].message;
const guildId = message.guild_id || null;
if (message.author.id != BDFDB.UserUtils.me.id && !BDFDB.LibraryModules.RelationshipStore.isBlocked(message.author.id)) {

View File

@ -2,7 +2,7 @@
* @name PersonalPins
* @author DevilBro
* @authorId 278543574059057154
* @version 2.1.0
* @version 2.1.1
* @description Allows you to locally pin Messages
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,13 +17,8 @@ module.exports = (_ => {
"info": {
"name": "PersonalPins",
"author": "DevilBro",
"version": "2.1.0",
"version": "2.1.1",
"description": "Allows you to locally pin Messages"
},
"changeLog": {
"added": {
"Tags": "You can now add tags to notes, they will be included in the search query, allowing you to find notes more easily with your own key words"
}
}
};
@ -426,7 +421,7 @@ module.exports = (_ => {
notes = BDFDB.DataUtils.load(this, "notes");
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.DispatchApiUtils, "dispatch", {after: e => {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == BDFDB.DiscordConstants.ActionTypes.MESSAGE_DELETE) {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == "MESSAGE_DELETE") {
let note = this.getNoteData({id: e.methodArguments[0].id, channel_id: e.methodArguments[0].channelId});
if (note) this.removeNoteData(note, true);
}

View File

@ -2,7 +2,7 @@
* @name ServerHider
* @author DevilBro
* @authorId 278543574059057154
* @version 6.2.3
* @version 6.2.4
* @description Allows you to hide certain Servers in your Server List
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,7 +17,7 @@ module.exports = (_ => {
"info": {
"name": "ServerHider",
"author": "DevilBro",
"version": "6.2.3",
"version": "6.2.4",
"description": "Allows you to hide certain Servers in your Server List"
}
};
@ -81,7 +81,7 @@ module.exports = (_ => {
hiddenEles = BDFDB.DataUtils.load(this, "hidden");
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.DispatchApiUtils, "dispatch", {after: e => {
if (e.methodArguments[0].type == BDFDB.DiscordConstants.ActionTypes.STREAMER_MODE_UPDATE) BDFDB.GuildUtils.rerenderAll(true);
if (e.methodArguments[0].type == "STREAMER_MODE_UPDATE") BDFDB.GuildUtils.rerenderAll(true);
}});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.FolderStore, "getGuildFolderById", {after: e => {

View File

@ -2,7 +2,7 @@
* @name ShowBadgesInChat
* @author DevilBro
* @authorId 278543574059057154
* @version 1.9.0
* @version 1.9.1
* @description Displays Badges (Nitro, Hypesquad, etc...) in the Chat/MemberList/DMList
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,13 +17,8 @@ module.exports = (_ => {
"info": {
"name": "ShowBadgesInChat",
"author": "DevilBro",
"version": "1.9.0",
"version": "1.9.1",
"description": "Displays Badges (Nitro, Hypesquad, etc...) in the Chat/MemberList/DMList"
},
"changeLog": {
"improved": {
"More Specific Settings": "You can now select more specifically where which Badges will be shown"
}
}
};
@ -178,27 +173,6 @@ module.exports = (_ => {
badgeConfigs[key].key = key;
}
// REMOVE 15.06.2022
let oldPlaces = BDFDB.DataUtils.load(this, "places");
let oldBadges = BDFDB.DataUtils.load(this, "badges");
let oldIndicators = BDFDB.DataUtils.load(this, "indicators");
if (Object.keys(oldBadges).length && Object.keys(oldIndicators).length && Object.keys(oldPlaces).length) {
for (let key in oldBadges) {
if (!badgeConfigs[key]) badgeConfigs[key] = {};
for (let key2 in oldPlaces) badgeConfigs[key][key2] = oldBadges[key] && oldPlaces[key2];
}
for (let key in oldIndicators) {
if (!badgeConfigs[key]) badgeConfigs[key] = {};
for (let key2 in oldPlaces) badgeConfigs[key][key2] = oldIndicators[key] && oldPlaces[key2];
}
BDFDB.DataUtils.remove(this, "general");
BDFDB.DataUtils.remove(this, "settings");
BDFDB.DataUtils.remove(this, "places");
BDFDB.DataUtils.remove(this, "badges");
BDFDB.DataUtils.remove(this, "indicators");
BDFDB.DataUtils.save(badgeConfigs, this, "badgeConfigs");
}
let badgeCache = BDFDB.DataUtils.load(this, "badgeCache");
if (badgeCache) {
let now = (new Date()).getTime(), month = 1000*60*60*24*30;
@ -227,11 +201,11 @@ module.exports = (_ => {
}
};
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.DispatchApiUtils, "dispatch", {after: e => {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == BDFDB.DiscordConstants.ActionTypes.USER_PROFILE_FETCH_FAILURE && e.methodArguments[0].userId) {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == "USER_PROFILE_FETCH_FAILURE" && e.methodArguments[0].userId) {
const user = BDFDB.LibraryModules.UserStore.getUser(e.methodArguments[0].userId);
processUser(e.methodArguments[0].userId, {user: user || {}, flags: user ? user.publicFlags : 0});
}
else if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == BDFDB.DiscordConstants.ActionTypes.USER_PROFILE_FETCH_SUCCESS && e.methodArguments[0].user) processUser(e.methodArguments[0].user.id, e.methodArguments[0])
else if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == "USER_PROFILE_FETCH_SUCCESS" && e.methodArguments[0].user) processUser(e.methodArguments[0].user.id, e.methodArguments[0])
}});
this.forceUpdateAll();

View File

@ -2,7 +2,7 @@
* @name ShowConnections
* @author DevilBro
* @authorId 278543574059057154
* @version 1.0.9
* @version 1.1.0
* @description Shows the connected Accounts of a User in the UserPopout
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,16 +17,8 @@ module.exports = (_ => {
"info": {
"name": "ShowConnections",
"author": "DevilBro",
"version": "1.0.9",
"version": "1.1.0",
"description": "Shows the connected Accounts of a User in the UserPopout"
},
"changeLog": {
"fixed": {
"Bright Icons": "Uses the white version of some icons if dark mode is enabled"
},
"added": {
"Copy Name/Link": "Right clicking an icon will give you the options to copy the name/link of a connection"
}
}
};
@ -124,7 +116,7 @@ module.exports = (_ => {
onStart () {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.DispatchApiUtils, "dispatch", {after: e => {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == BDFDB.DiscordConstants.ActionTypes.USER_PROFILE_FETCH_SUCCESS && e.methodArguments[0].user && e.methodArguments[0].connected_accounts) {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].type == "USER_PROFILE_FETCH_SUCCESS" && e.methodArguments[0].user && e.methodArguments[0].connected_accounts) {
const user = e.methodArguments[0].user;
delete requestedUsers[user.id];
loadedUsers[user.id] = e.methodArguments[0].connected_accounts;

View File

@ -2,7 +2,7 @@
* @name SpellCheck
* @author DevilBro
* @authorId 278543574059057154
* @version 1.6.3
* @version 1.6.4
* @description Adds a Spell Check to all Message Inputs. Select a Word and Right Click it to add it to your Dictionary
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,14 +17,8 @@ module.exports = (_ => {
"info": {
"name": "SpellCheck",
"author": "DevilBro",
"version": "1.6.3",
"version": "1.6.4",
"description": "Adds a Spell Check to all Message Inputs. Select a Word and Right Click it to add it to your Dictionary"
},
"changeLog": {
"improved": {
"Conjoined Words": "Now properly splits conjoined words and checks each segment of the conjoinment, for example 'green-blue' will no longer show as error",
"Quotes": "Added “ ” to special symbols"
}
}
};
@ -106,7 +100,7 @@ module.exports = (_ => {
let dictionaryLanguageIds = Array.from(BDFDB.DOMUtils.create(body).querySelectorAll(`[href*="/mwittrien/BetterDiscordAddons/blob/master/Plugins/SpellCheck/dic/"]`)).map(n => n.innerText.split(".")[0]).filter(n => n);
languages = BDFDB.ObjectUtils.filter(BDFDB.LanguageUtils.languages, langId => dictionaryLanguageIds.includes(langId), true);
if (BDFDB.LibraryModules.SpellCheckStore && BDFDB.LibraryModules.SpellCheckStore.isEnabled()) BDFDB.LibraryModules.DispatchApiUtils.dispatch({type: BDFDB.DiscordConstants.ActionTypes.SPELLCHECK_TOGGLE});
if (BDFDB.LibraryModules.SpellCheckStore && BDFDB.LibraryModules.SpellCheckStore.isEnabled()) BDFDB.LibraryModules.DispatchApiUtils.dispatch({type: "SPELLCHECK_TOGGLE"});
BDFDB.PatchUtils.forceAllUpdates(this);