This commit is contained in:
Mirco Wittrien 2020-07-01 14:49:25 +02:00
parent 1f5ae64722
commit b1cf36858a
3 changed files with 4 additions and 5 deletions

View File

@ -1663,6 +1663,7 @@
LibraryModules.LoginUtils = BDFDB.ModuleUtils.findByProperties("login", "logout");
LibraryModules.MemberStore = BDFDB.ModuleUtils.findByProperties("getMember", "getMembers");
LibraryModules.MentionUtils = BDFDB.ModuleUtils.findByProperties("isRawMessageMentioned", "isMentioned");
LibraryModules.MessageManageUtils = BDFDB.ModuleUtils.findByProperties("copyLink", "quoteMessage");
LibraryModules.MessagePinUtils = BDFDB.ModuleUtils.findByProperties("pinMessage", "unpinMessage");
LibraryModules.MessageStore = BDFDB.ModuleUtils.findByProperties("getMessage", "getMessages");
LibraryModules.MessageUtils = BDFDB.ModuleUtils.findByProperties("receiveMessage", "editMessage");

File diff suppressed because one or more lines are too long

View File

@ -345,7 +345,7 @@ var MessageUtilities = (_ => {
doCopyLink ({messageDiv, message}, action) {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(message.channel_id);
if (channel) {
BDFDB.LibraryRequires.electron.clipboard.write({text:`https://discordapp.com/channels/${channel.guild_id || BDFDB.DiscordConstants.ME}/${channel.id}/${message.id}`});
BDFDB.LibraryModules.MessageManageUtils.copyLink(channel, message);
if (toasts[action]) BDFDB.NotificationUtils.toast("Messagelink has been copied.", {type:"success"});
}
}
@ -353,9 +353,7 @@ var MessageUtilities = (_ => {
doQuote ({messageDiv, message}, action) {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(message.channel_id);
if (channel && BDFDB.LibraryModules.QuoteUtils.canQuote(message, channel)) {
BDFDB.LibraryModules.DispatchUtils.ComponentDispatch.dispatch(BDFDB.DiscordConstants.ComponentActions.INSERT_QUOTE_TEXT, {
text: BDFDB.LibraryModules.QuoteUtils.createQuotedText(message, channel)
});
BDFDB.LibraryModules.MessageManageUtils.quoteMessage(channel, message);
if (toasts[action]) BDFDB.NotificationUtils.toast("Quote has been created.", {type:"success"});
}
}