Update ClickableMentions.plugin.js
This commit is contained in:
parent
1d260bff2e
commit
6f111e40f6
|
@ -2,7 +2,7 @@
|
||||||
* @name ClickableMentions
|
* @name ClickableMentions
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 1.0.4
|
* @version 1.0.5
|
||||||
* @description Allows you to open a User Popout by clicking a Mention in your Message Input
|
* @description Allows you to open a User Popout by clicking a Mention in your Message Input
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -59,9 +59,13 @@ module.exports = (_ => {
|
||||||
return class ClickableMentions extends Plugin {
|
return class ClickableMentions extends Plugin {
|
||||||
onLoad () {
|
onLoad () {
|
||||||
this.patchedModules = {
|
this.patchedModules = {
|
||||||
|
before: {
|
||||||
|
RoleMention: "default"
|
||||||
|
},
|
||||||
after: {
|
after: {
|
||||||
RichUserMention: "UserMention",
|
RichUserMention: "UserMention",
|
||||||
RichRoleMention: "RoleMention"
|
RichRoleMention: "RoleMention",
|
||||||
|
RoleMention: "default"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -95,7 +99,7 @@ module.exports = (_ => {
|
||||||
channelId = BDFDB.LibraryModules.GuildChannelStore.getSelectableChannelIds(guild.id).indexOf(currentChannelId) > -1 ? currentChannelId : BDFDB.LibraryModules.GuildChannelStore.getDefaultChannel(guild.id).id;
|
channelId = BDFDB.LibraryModules.GuildChannelStore.getSelectableChannelIds(guild.id).indexOf(currentChannelId) > -1 ? currentChannelId : BDFDB.LibraryModules.GuildChannelStore.getDefaultChannel(guild.id).id;
|
||||||
}
|
}
|
||||||
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.RoleMention, {
|
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.RoleMention, {
|
||||||
type: "mention",
|
type: "mention_textarea",
|
||||||
children: [`@${guild.roles[e.instance.props.id].name}`],
|
children: [`@${guild.roles[e.instance.props.id].name}`],
|
||||||
content: [
|
content: [
|
||||||
{type: "text", content: `@${guild.roles[e.instance.props.id].name}`}
|
{type: "text", content: `@${guild.roles[e.instance.props.id].name}`}
|
||||||
|
@ -108,6 +112,18 @@ module.exports = (_ => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processRoleMention (e) {
|
||||||
|
if (!e.returnvalue) {
|
||||||
|
if (e.instance.props.type == "mention_textarea") {
|
||||||
|
e.instance.props.type = "mention";
|
||||||
|
e.instance.props.place = "textarea";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (e.instance.props.place == "textarea") {
|
||||||
|
e.returnvalue.props.align = BDFDB.LibraryComponents.PopoutContainer.Align.BOTTOM;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
})(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog));
|
})(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog));
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue