1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-06 10:52:31 +01:00

Fix the feature check

This commit is contained in:
Erkin Alp Güney 2022-01-12 16:04:34 +03:00 committed by GitHub
parent 8985ad1cf3
commit 277b28c000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ import {
Channel,
Embed,
emitEvent,
Guild,
Message,
MessageCreateEvent,
MessageUpdateEvent,
@ -81,6 +82,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
if (opts.message_reference) {
permission.hasThrow("READ_MESSAGE_HISTORY");
// code below has to be redone when we add custom message routing and cross-channel replies
const guild = await Guild.findOneOrFail({ id: guild_id });
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.channel_id !== opts.channel_id) throw new HTTPError("You can only reference messages from this channel");