This commit is contained in:
Mirco Wittrien 2023-11-02 09:12:52 +01:00
parent 09db1336a0
commit c9c31b13b6
4 changed files with 34 additions and 33 deletions

View File

@ -2,7 +2,7 @@
* @name BDFDB
* @author DevilBro
* @authorId 278543574059057154
* @version 3.4.9
* @version 3.5.0
* @description Required Library for DevilBro's Plugins
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien

View File

@ -145,8 +145,8 @@
}},
"MediaEngineUtils": {"props": ["setOutputDevice", "setInputDevice"]},
"MemberDisplayUtils": {"strings": ["getUserProfile", "getGuildMemberProfile", ".getUser("], "exported": false, "value": "exports", "map": {
"getDisplayProfile": ["getUserProfile"],
"getUserProfile": ["function(){return"]
"getDisplayProfile": ["getDisplayProfile"],
"getUserProfile": ["default"]
}},
"MentionUtils": {"strings": ["rawMessage", "mention_everyone", "mentionUsers"], "exported": false, "value": "exports", "map": {
"isRawMessageMentioned": ["rawMessage", "mention_everyone", "mentionUsers"]

View File

@ -2,7 +2,7 @@
* @name ShowBadgesInChat
* @author DevilBro
* @authorId 278543574059057154
* @version 2.0.1
* @version 2.0.2
* @description Displays Badges (Nitro, Hypesquad, etc...) in the Chat/MemberList/DMList
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -83,8 +83,10 @@ module.exports = (_ => {
_this = this;
this.modulePatches = {
before: [
"NameContainer"
],
after: [
"MemberListItem",
"MessageUsername",
"PrivateChannel",
"UserBadges"
@ -394,9 +396,9 @@ module.exports = (_ => {
this.injectBadges(children, author, (BDFDB.LibraryStores.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id, "chat");
}
processMemberListItem (e) {
processNameContainer (e) {
if (!e.instance.props.user) return;
this.injectBadges(BDFDB.ObjectUtils.get(e.returnvalue, "props.decorators.props.children"), e.instance.props.user, e.instance.props.channel.guild_id, "memberList");
this.injectBadges(BDFDB.ObjectUtils.get(e.instance, "props.decorators.props.children"), e.instance.props.user, e.instance.props.channel.guild_id, "memberList");
}
processPrivateChannel (e) {
@ -421,30 +423,29 @@ module.exports = (_ => {
}
processUserBadges (e) {
if (e.instance.props.custom) {
let filter = e.instance.props.place != "settings";
for (let i in e.returnvalue.props.children) if (e.returnvalue.props.children[i]) {
let keyName = filter && Object.keys(badges).find(n => badges[n].keys.includes(e.returnvalue.props.children[i].key));
if (keyName && badgeConfigs[keyName] && !badgeConfigs[keyName][e.instance.props.place]) e.returnvalue.props.children[i] = null;
else if (typeof e.returnvalue.props.children[i].props.children == "function" && e.returnvalue.props.children[i].props.text) {
e.returnvalue.props.children[i] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, e.returnvalue.props.children[i].props);
}
if (!e.instance.props.custom) return;
let filter = e.instance.props.place != "settings";
for (let i in e.returnvalue.props.children) if (e.returnvalue.props.children[i]) {
let keyName = filter && Object.keys(badges).find(n => badges[n].keys.includes(e.returnvalue.props.children[i].key));
if (keyName && badgeConfigs[keyName] && !badgeConfigs[keyName][e.instance.props.place]) e.returnvalue.props.children[i] = null;
else if (typeof e.returnvalue.props.children[i].props.children == "function" && e.returnvalue.props.children[i].props.text) {
e.returnvalue.props.children[i] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, e.returnvalue.props.children[i].props);
}
if (e.instance.props.premiumCurrentGuildSince && !(filter && badgeConfigs.CURRENT_GUILD_BOOST && !badgeConfigs.CURRENT_GUILD_BOOST[e.instance.props.place])) e.returnvalue.props.children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: BDFDB.LanguageUtils.LanguageStringsFormat("PREMIUM_GUILD_SUBSCRIPTION_TOOLTIP", e.instance.props.premiumCurrentGuildSince),
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
className: BDFDB.disCN.userbadgeouter,
children: BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS.userbadge + BDFDB.disCN._showbadgesinchatindicator,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.memberpremiumicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.BOOST
})
}
if (e.instance.props.premiumCurrentGuildSince && !(filter && badgeConfigs.CURRENT_GUILD_BOOST && !badgeConfigs.CURRENT_GUILD_BOOST[e.instance.props.place])) e.returnvalue.props.children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: BDFDB.LanguageUtils.LanguageStringsFormat("PREMIUM_GUILD_SUBSCRIPTION_TOOLTIP", e.instance.props.premiumCurrentGuildSince),
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
className: BDFDB.disCN.userbadgeouter,
children: BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS.userbadge + BDFDB.disCN._showbadgesinchatindicator,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.memberpremiumicon,
name: BDFDB.LibraryComponents.SvgIcon.Names.BOOST
})
})
}));
if (!e.returnvalue.props.children.filter(n => n).length) return null;
}
})
}));
if (!e.returnvalue.props.children.filter(n => n).length) return null;
}
injectBadges (children, user, guildId, place) {

View File

@ -2,7 +2,7 @@
* @name TopRoleEverywhere
* @author DevilBro
* @authorId 278543574059057154
* @version 3.1.2
* @version 3.1.3
* @description Adds the highest Role of a User as a Tag
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -77,10 +77,10 @@ module.exports = (_ => {
this.modulePatches = {
before: [
"MessageHeader"
"MessageHeader",
"NameContainer"
],
after: [
"MemberListItem",
"VoiceUser"
]
};
@ -169,8 +169,8 @@ module.exports = (_ => {
BDFDB.MessageUtils.rerenderAll();
}
processMemberListItem (e) {
if (e.instance.props.user && this.settings.places.memberList) this.injectRoleTag(BDFDB.ObjectUtils.get(e.returnvalue, "props.decorators.props.children"), e.instance.props.user, "member", 2, {
processNameContainer (e) {
if (e.instance.props.user && this.settings.places.memberList) this.injectRoleTag(BDFDB.ObjectUtils.get(e.instance, "props.decorators.props.children"), e.instance.props.user, "member", 2, {
tagClass: BDFDB.disCN.bottagmember
});
}