mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-06 19:02:33 +01:00
Add unhandled channel types to IsTextChannel method
This commit is contained in:
parent
028fd7b8b3
commit
d6f5a08cb5
@ -37,7 +37,11 @@ export function isTextChannel(type: ChannelType): boolean {
|
|||||||
case ChannelType.GUILD_PUBLIC_THREAD:
|
case ChannelType.GUILD_PUBLIC_THREAD:
|
||||||
case ChannelType.GUILD_PRIVATE_THREAD:
|
case ChannelType.GUILD_PRIVATE_THREAD:
|
||||||
case ChannelType.GUILD_TEXT:
|
case ChannelType.GUILD_TEXT:
|
||||||
|
case ChannelType.ENCRYPTED:
|
||||||
|
case ChannelType.ENCRYPTED_THREAD:
|
||||||
return true;
|
return true;
|
||||||
|
default:
|
||||||
|
throw new HTTPError("unimplemented", 400);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +91,7 @@ router.get("/", async (req: Request, res: Response) => {
|
|||||||
permissions.hasThrow("VIEW_CHANNEL");
|
permissions.hasThrow("VIEW_CHANNEL");
|
||||||
if (!permissions.has("READ_MESSAGE_HISTORY")) return res.json([]);
|
if (!permissions.has("READ_MESSAGE_HISTORY")) return res.json([]);
|
||||||
|
|
||||||
var query: FindManyOptions<Message> & { where: { id?: any } } = {
|
var query: FindManyOptions<Message> & { where: { id?: any; }; } = {
|
||||||
order: { id: "DESC" },
|
order: { id: "DESC" },
|
||||||
take: limit,
|
take: limit,
|
||||||
where: { channel_id },
|
where: { channel_id },
|
||||||
@ -216,7 +220,7 @@ router.post(
|
|||||||
channel.save()
|
channel.save()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
postHandleMessage(message).catch((e) => {}); // no await as it shouldnt block the message send function and silently catch error
|
postHandleMessage(message).catch((e) => { }); // no await as it shouldnt block the message send function and silently catch error
|
||||||
|
|
||||||
return res.json(message);
|
return res.json(message);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user