Webpack: Export DraftActions & PinActions

This commit is contained in:
thororen1234 2025-12-31 20:37:57 -05:00
parent 5f3854284a
commit a52b5924ac
No known key found for this signature in database
2 changed files with 4 additions and 6 deletions

View file

@ -7,8 +7,7 @@
import { definePluginSettings } from "@api/Settings";
import { Devs, EquicordDevs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { MessageActions } from "@webpack/common";
import { MessageActions, PinActions } from "@webpack/common";
const settings = definePluginSettings({
noShiftDelete: {
@ -23,8 +22,6 @@ const settings = definePluginSettings({
},
});
const PinActions = findByPropsLazy("pinMessage", "unpinMessage");
export default definePlugin({
name: "ShowAllMessageButtons",
description: "Always show all message buttons no matter if you are holding the shift key or not.",
@ -57,8 +54,7 @@ export default definePlugin({
MessageActions.deleteMessage(channel_id, id);
},
toggleMessagePin({ channel, message }) {
if (message.pinned)
return PinActions.unpinMessage(channel, message.id);
if (message.pinned) return PinActions.unpinMessage(channel, message.id);
PinActions.pinMessage(channel, message.id);
},

View file

@ -189,6 +189,8 @@ export const ChannelActionCreators = findByPropsLazy("openPrivateChannel");
export const VoiceActions = findByPropsLazy("toggleSelfMute");
export const GuildActions = findByPropsLazy("setServerMute", "setServerDeaf");
export const ChannelActions = findByPropsLazy("selectChannel", "selectVoiceChannel");
export const DraftActions = findByPropsLazy("saveDraft", "changeDraft");
export const PinActions = findByPropsLazy("pinMessage", "unpinMessage");
export const IconUtils: t.IconUtils = findByPropsLazy("getGuildBannerURL", "getUserAvatarURL");