fix(api): working replies in dm channels
This commit is contained in:
parent
b1f04543bd
commit
64f0b1f1a1
@ -82,11 +82,13 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
|
|||||||
if (opts.message_reference) {
|
if (opts.message_reference) {
|
||||||
permission.hasThrow("READ_MESSAGE_HISTORY");
|
permission.hasThrow("READ_MESSAGE_HISTORY");
|
||||||
// code below has to be redone when we add custom message routing and cross-channel replies
|
// code below has to be redone when we add custom message routing and cross-channel replies
|
||||||
|
if (message.guild_id !== null) {
|
||||||
const guild = await Guild.findOneOrFail({ id: channel.guild_id });
|
const guild = await Guild.findOneOrFail({ id: channel.guild_id });
|
||||||
if (!guild.features.includes("CROSS_CHANNEL_REPLIES")) {
|
if (!guild.features.includes("CROSS_CHANNEL_REPLIES")) {
|
||||||
if (opts.message_reference.guild_id !== channel.guild_id) throw new HTTPError("You can only reference messages from this guild");
|
if (opts.message_reference.guild_id !== channel.guild_id) throw new HTTPError("You can only reference messages from this guild");
|
||||||
if (opts.message_reference.channel_id !== opts.channel_id) throw new HTTPError("You can only reference messages from this channel");
|
if (opts.message_reference.channel_id !== opts.channel_id) throw new HTTPError("You can only reference messages from this channel");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// TODO: should be checked if the referenced message exists?
|
// TODO: should be checked if the referenced message exists?
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
message.type = MessageType.REPLY;
|
message.type = MessageType.REPLY;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user