mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-06 10:52:31 +01:00
Add unhandled channel types to IsTextChannel method
This commit is contained in:
parent
b08bb30075
commit
14a4321c0f
@ -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 },
|
||||||
|
Loading…
Reference in New Issue
Block a user