reply to message with channel webhook

Is it possible to use Webhook.send() to reply to a message in the same channel? I followed the docs and it makes it look like you could add the reply parameter to the MessagePayload.create() and set the reference like described in this question in this forum djs-questionsReply to a message as bot.

This is the code I am using. The message sends to the right channel and everything but it doesn't show the reference like other replies.

public async sendRpMessage(options: WebhookMessageCreateOptions, channel: GuildTextBasedChannel, char: Character, msgToReply: Message = null) {
        let opts = {
            username: parseServerNickname(char),
            avatarURL: char.avatar_url,
            ...options
        };
        if (channel.isThread()) {
            opts = { threadId: channel.id, ...opts };
        }
        const rpHook = await this.findOrCreateRpHook(channel);
        if (rpHook) {
            if (msgToReply) {
                const payload = MessagePayload.create(rpHook, { reply: { messageReference: msgToReply.id }, ...opts });
                return rpHook.send(payload);
            }

            return rpHook.send(opts);
        } else {
            console.log('unable to find or create webhook for:' + channel.id);
        }
        return null;
    }
Was this page helpful?