Update Translator.plugin.js

This commit is contained in:
Mirco Wittrien 2022-10-31 21:10:36 +01:00
parent d0d8ac8ba5
commit a39f375d34
1 changed files with 7 additions and 8 deletions

View File

@ -2,7 +2,7 @@
* @name Translator
* @author DevilBro
* @authorId 278543574059057154
* @version 2.4.2
* @version 2.4.3
* @description Allows you to translate Messages and your outgoing Messages within Discord
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -653,7 +653,7 @@ module.exports = (_ => {
}
processChannelTextAreaContainer (e) {
if (e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL && e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY) return;
if (e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL && e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY && e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.SIDEBAR) return;
BDFDB.PatchUtils.patch(this, e.instance.props, "onSubmit", {instead: e2 => {
if (this.isTranslationEnabled(e.instance.props.channel.id) && e2.methodArguments[0].value) {
e2.stopOriginalMethodCall();
@ -675,12 +675,11 @@ module.exports = (_ => {
}
processChannelTextAreaButtons (e) {
if (this.settings.general.addTranslateButton && (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) && !e.instance.props.disabled) {
e.returnvalue.props.children.unshift(BDFDB.ReactUtils.createElement(TranslateButtonComponent, {
guildId: e.instance.props.channel.guild_id ? e.instance.props.channel.guild_id : "@me",
channelId: e.instance.props.channel.id
}));
}
if (!this.settings.general.addTranslateButton || e.instance.props.disabled || e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL && e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY && e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.SIDEBAR) return;
e.returnvalue.props.children.unshift(BDFDB.ReactUtils.createElement(TranslateButtonComponent, {
guildId: e.instance.props.channel.guild_id ? e.instance.props.channel.guild_id : "@me",
channelId: e.instance.props.channel.id
}));
}
processMessages (e) {