Added config
This commit is contained in:
parent
77ff6515f3
commit
0419f102f8
1 changed files with 27 additions and 7 deletions
34
index.tsx
34
index.tsx
|
@ -1,3 +1,5 @@
|
||||||
|
/* eslint-disable simple-header/header */
|
||||||
|
/* eslint-disable indent */
|
||||||
/*
|
/*
|
||||||
* Vencord, a modification for Discord's desktop app
|
* Vencord, a modification for Discord's desktop app
|
||||||
* Copyright (c) 2023 your mom lol
|
* Copyright (c) 2023 your mom lol
|
||||||
|
@ -16,13 +18,14 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import definePlugin from "@utils/types";
|
|
||||||
import { addButton, removeButton } from "@api/MessagePopover";
|
import { addButton, removeButton } from "@api/MessagePopover";
|
||||||
import { ChannelStore } from "@webpack/common";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { PropsWithChildren } from "react";
|
|
||||||
|
|
||||||
import { classes } from "@utils/misc";
|
import { classes } from "@utils/misc";
|
||||||
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
|
import { ChannelStore, RestAPI } from "@webpack/common";
|
||||||
import type { SVGProps } from "react";
|
import type { SVGProps } from "react";
|
||||||
|
// eslint-disable-next-line no-duplicate-imports
|
||||||
|
import { PropsWithChildren } from "react";
|
||||||
|
|
||||||
|
|
||||||
interface BaseIconProps extends IconProps {
|
interface BaseIconProps extends IconProps {
|
||||||
|
@ -68,12 +71,24 @@ export function Husk(props: IconProps) {
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "Husk",
|
name: "Husk",
|
||||||
description: "Adds husk button (works only on the Vencord Server if no nitro)",
|
description: "Adds Husk button (check settings to change used emoji)",
|
||||||
authors: [{
|
authors: [{
|
||||||
name: "nina",
|
name: "nina",
|
||||||
id: 886685857560539176n
|
id: 886685857560539176n
|
||||||
}],
|
}],
|
||||||
dependencies: ["MessagePopoverAPI"],
|
dependencies: ["MessagePopoverAPI"],
|
||||||
|
settings: definePluginSettings({
|
||||||
|
emojiName: {
|
||||||
|
description: "Default (from Vencord Server): husk",
|
||||||
|
type: OptionType.STRING,
|
||||||
|
default: "husk"
|
||||||
|
},
|
||||||
|
emojiID: {
|
||||||
|
description: "Default (from Vencord Server): 1026532993923293184",
|
||||||
|
type: OptionType.BIGINT,
|
||||||
|
default: 1026532993923293184n
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
addButton("Husk", msg => {
|
addButton("Husk", msg => {
|
||||||
|
@ -82,7 +97,12 @@ export default definePlugin({
|
||||||
icon: Husk,
|
icon: Husk,
|
||||||
message: msg,
|
message: msg,
|
||||||
channel: ChannelStore.getChannel(msg.channel_id),
|
channel: ChannelStore.getChannel(msg.channel_id),
|
||||||
onClick: () => Vencord.Webpack.findByProps("addReaction").addReaction(msg.channel_id, msg.id, {id: '1026532993923293184', name: 'husk', animated: false})
|
onClick: () => {
|
||||||
|
RestAPI.put({
|
||||||
|
url: `/channels/${msg.channel_id}/messages/${msg.id}/reactions/${this.settings.store.emojiName}:${this.settings.store.emojiID}/@me`
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -91,4 +111,4 @@ export default definePlugin({
|
||||||
removeButton("Husk");
|
removeButton("Husk");
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue