Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
thororen1234 2025-08-13 16:30:16 -04:00
commit 4f4c806a9f
No known key found for this signature in database
3 changed files with 11 additions and 11 deletions

View file

@ -1,7 +1,7 @@
{
"name": "equicord",
"private": "true",
"version": "1.12.9",
"version": "1.12.10",
"description": "The other cutest Discord client mod",
"homepage": "https://github.com/Equicord/Equicord#readme",
"bugs": {
@ -115,4 +115,4 @@
"engines": {
"node": ">=18"
}
}
}

View file

@ -66,7 +66,7 @@ export interface MessageReplyOptions {
};
}
export interface MessageExtra {
export interface MessageOptions {
stickers?: string[];
uploads?: Upload[];
replyOptions: MessageReplyOptions;
@ -76,17 +76,17 @@ export interface MessageExtra {
openWarningPopout: (props: any) => any;
}
export type MessageSendListener = (channelId: string, messageObj: MessageObject, extra: MessageExtra) => Promisable<void | { cancel: boolean; }>;
export type MessageSendListener = (channelId: string, messageObj: MessageObject, options: MessageOptions) => Promisable<void | { cancel: boolean; }>;
export type MessageEditListener = (channelId: string, messageId: string, messageObj: MessageObject) => Promisable<void | { cancel: boolean; }>;
const sendListeners = new Set<MessageSendListener>();
const editListeners = new Set<MessageEditListener>();
export async function _handlePreSend(channelId: string, messageObj: MessageObject, extra: MessageExtra, replyOptions: MessageReplyOptions) {
extra.replyOptions = replyOptions;
export async function _handlePreSend(channelId: string, messageObj: MessageObject, options: MessageOptions, replyOptions: MessageReplyOptions) {
options.replyOptions = replyOptions;
for (const listener of sendListeners) {
try {
const result = await listener(channelId, messageObj, extra);
const result = await listener(channelId, messageObj, options);
if (result?.cancel) {
return true;
}

View file

@ -110,7 +110,7 @@ export function insertTextIntoChatInputBox(text: string) {
});
}
interface MessageExtra {
interface MessageOptions {
messageReference: Message["messageReference"];
allowedMentions: {
parse: string[];
@ -122,8 +122,8 @@ interface MessageExtra {
export function sendMessage(
channelId: string,
data: Partial<MessageObject>,
waitForChannelReady?: boolean,
extra?: Partial<MessageExtra>
waitForChannelReady = true,
options: Partial<MessageOptions> = {}
) {
const messageData = {
content: "",
@ -133,7 +133,7 @@ export function sendMessage(
...data
};
return MessageActions.sendMessage(channelId, messageData, waitForChannelReady, extra);
return MessageActions.sendMessage(channelId, messageData, waitForChannelReady, options);
}
/**