Skip to content

Commit 3d48f20

Browse files
committed
feat: reply back to original message
1 parent 02ab2e8 commit 3d48f20

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/components/events/message.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ import * as Sentry from "@sentry/node";
2727
const commandPrefix: string = process.env.COMMAND_PREFIX || "!";
2828
const commandPrefixLess: boolean = process.env.COMMAND_PREFIX_LESS === "true";
2929

30+
async function getQoutedMessageId(msg: Message): Promise<string> {
31+
if (!msg.hasQuotedMsg) return msg.id.remote;
32+
33+
const qouted = await msg.getQuotedMessage();
34+
return qouted.id.remote;
35+
}
36+
3037
export default async function (msg: Message, type: string): Promise<void> {
3138
try {
3239
// ignore message if it is older than 60 seconds
@@ -220,7 +227,7 @@ export default async function (msg: Message, type: string): Promise<void> {
220227
messageBody,
221228
options,
222229
);
223-
return await originalReply(messageBody, chatId, options);
230+
return await originalReply(messageBody, await getQoutedMessageId(msg), options);
224231
};
225232

226233
if (!msg.fromMe) {

0 commit comments

Comments
 (0)