mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 15:22:43 +00:00
1 parent
90ba897ca4
commit
4baa6e0620
1 file changed
+4
-2
@@ -81,8 +81,10 @@ 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
|
||||
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 (!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");
|
||||
}
|
||||
// TODO: should be checked if the referenced message exists?
|
||||
// @ts-ignore
|
||||
message.type = MessageType.REPLY;
|
||||
|
||||
Reference in new issue
Block a user