Update StaffTag.plugin.js

This commit is contained in:
Mirco Wittrien 2022-10-22 11:42:41 +02:00
parent 95a3a00c9a
commit bec28e72ab
1 changed files with 6 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* @name StaffTag * @name StaffTag
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.5.7 * @version 1.5.8
* @description Adds a Crown/Tag to Server Owners (or Admins/Management) * @description Adds a Crown/Tag to Server Owners (or Admins/Management)
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -90,9 +90,11 @@ module.exports = (_ => {
onLoad () { onLoad () {
this.modulePatches = { this.modulePatches = {
before: [
"MessageHeader"
],
after: [ after: [
"MemberListItem", "MemberListItem",
"MessageUsername",
"NameTag", "NameTag",
"UsernameSection", "UsernameSection",
"UserPopoutInfo", "UserPopoutInfo",
@ -269,9 +271,9 @@ module.exports = (_ => {
} }
} }
processMessageUsername (e) { processMessageHeader (e) {
if (!e.instance.props.message || !this.settings.tagPlaces.chat) return; if (!e.instance.props.message || !this.settings.tagPlaces.chat) return;
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: n => n && n.props && typeof n.props.renderPopout == "function"}); let [children, index] = BDFDB.ReactUtils.findParent(e.instance.props.username, {filter: n => n && n.props && typeof n.props.renderPopout == "function"});
if (index == -1) return; if (index == -1) return;
const author = e.instance.props.userOverride || e.instance.props.message.author; const author = e.instance.props.userOverride || e.instance.props.message.author;
let userType = this.getUserType(author, e.instance.props.message.channel_id); let userType = this.getUserType(author, e.instance.props.message.channel_id);