Plugin

GifPaste

Makes picking a gif in the gif picker insert a link into the chatbox instead of instantly sending it

Media Chat
index.ts
Download

Source

src/plugins/gifPaste/index.ts
1import { Devs } from "@utils/constants";
2import { insertTextIntoChatInputBox } from "@utils/discord";
3import definePlugin from "@utils/types";
4import { ExpressionPickerStore } from "@webpack/common";
5
6export default definePlugin({
7 name: "GifPaste",
8 description: "Makes picking a gif in the gif picker insert a link into the chatbox instead of instantly sending it",
9 tags: ["Media", "Chat"],
10 authors: [Devs.Ven],
11
12 patches: [{
13 find: "handleSelectGIF=",
14 replacement: {
15 match: /handleSelectGIF=(\i)=>\{/,
16 replace: "$&if (!this?.props?.className) return $self.handleSelect($1);"
17 }
18 }],
19
20 handleSelect(gif?: { url: string; }) {
21 if (gif) {
22 insertTextIntoChatInputBox(gif.url + " ");
23 ExpressionPickerStore.closeExpressionPicker();
24 }
25 }
26});
27