Update StaffTag.plugin.js
This commit is contained in:
parent
2986ce1427
commit
95a3a00c9a
|
@ -2,7 +2,7 @@
|
||||||
* @name StaffTag
|
* @name StaffTag
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 1.5.6
|
* @version 1.5.7
|
||||||
* @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
|
||||||
|
@ -88,15 +88,16 @@ module.exports = (_ => {
|
||||||
|
|
||||||
return class StaffTag extends Plugin {
|
return class StaffTag extends Plugin {
|
||||||
onLoad () {
|
onLoad () {
|
||||||
this.patchedModules = {
|
|
||||||
after: {
|
this.modulePatches = {
|
||||||
MemberListItem: "render",
|
after: [
|
||||||
MessageUsername: "default",
|
"MemberListItem",
|
||||||
VoiceUser: "render",
|
"MessageUsername",
|
||||||
NameTag: "default",
|
"NameTag",
|
||||||
UsernameSection: "default",
|
"UsernameSection",
|
||||||
UserPopoutInfo: "UserPopoutInfo"
|
"UserPopoutInfo",
|
||||||
}
|
"VoiceUser"
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
this.defaults = {
|
this.defaults = {
|
||||||
|
@ -270,7 +271,7 @@ module.exports = (_ => {
|
||||||
|
|
||||||
processMessageUsername (e) {
|
processMessageUsername (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, {name: "Popout"});
|
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {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);
|
||||||
|
|
Loading…
Reference in New Issue