1
0
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:
Madeline 2022-01-15 18:42:29 +11:00 committed by Erkin Alp Güney
parent 028fd7b8b3
commit d6f5a08cb5

View File

@ -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 },