mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-20 20:07:03 -04:00
RemixMe: Balloons
This commit is contained in:
parent
a72ef38696
commit
88a2131eb2
5 changed files with 215 additions and 212 deletions
|
@ -38,6 +38,8 @@ export interface Upload {
|
|||
filename: string;
|
||||
id: string;
|
||||
isImage: boolean;
|
||||
isRemix?: boolean;
|
||||
isThumbnail: boolean;
|
||||
isVideo: boolean;
|
||||
item: {
|
||||
file: File;
|
||||
|
|
|
@ -4,20 +4,20 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { addMessagePreSendListener, type MessageExtra, type MessageObject, type MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
|
||||
import { addMessagePreSendListener, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
|
||||
import type { UploadWithRemix } from "./types";
|
||||
|
||||
|
||||
const handleMessage: MessageSendListener = (_: string, __: MessageObject, ex: MessageExtra) =>
|
||||
ex.uploads && (ex.uploads as UploadWithRemix[]).forEach(att => att.isRemix = true);
|
||||
const handleMessage: MessageSendListener = (_, __, ex) => ex.uploads && ex.uploads.forEach(att => att.isRemix = true);
|
||||
|
||||
export default definePlugin({
|
||||
name: "RemixMe",
|
||||
description: "Turns every single message with attachment to have remix tag",
|
||||
authors: [EquicordDevs.meowabyte],
|
||||
start: () => addMessagePreSendListener(handleMessage),
|
||||
stop: () => removeMessagePreSendListener(handleMessage)
|
||||
start() {
|
||||
addMessagePreSendListener(handleMessage);
|
||||
},
|
||||
stop() {
|
||||
removeMessagePreSendListener(handleMessage);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
/*
|
||||
* Vencord, a Discord client mod
|
||||
* Copyright (c) 2025 Vendicated and contributors
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { Upload } from "@api/MessageEvents";
|
||||
|
||||
export type UploadWithRemix = Upload & { isRemix?: boolean; };
|
|
@ -5,8 +5,10 @@
|
|||
*/
|
||||
|
||||
import { NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||
import { addMessagePreSendListener, MessageExtra, MessageObject, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
|
||||
import { CodeBlock } from "@components/CodeBlock";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { UploadWithRemix } from "@equicordplugins/remixMe/types";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { getIntlMessage } from "@utils/discord";
|
||||
import { Margins } from "@utils/margins";
|
||||
|
@ -125,6 +127,8 @@ function makeContextCallback(
|
|||
};
|
||||
}
|
||||
|
||||
const handleMessage: MessageSendListener = (_: string, __: MessageObject, ex: MessageExtra) => ex.uploads && (ex.uploads as UploadWithRemix[]).forEach(att => console.log(att));
|
||||
|
||||
export default definePlugin({
|
||||
name: "ViewRawVariant",
|
||||
description: "Copy/View raw content of any message, channel, or guild, but show in the right click menu.",
|
||||
|
@ -143,4 +147,10 @@ export default definePlugin({
|
|||
openViewRawModal(cleanMessage(val), "Message", true),
|
||||
),
|
||||
},
|
||||
start() {
|
||||
addMessagePreSendListener(handleMessage);
|
||||
},
|
||||
stop() {
|
||||
removeMessagePreSendListener(handleMessage);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue