This commit is contained in:
Skillz
2020-10-27 12:58:27 -04:00
parent b01c96df6a
commit b65c31dcb2
2 changed files with 7 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ name: Discordeno
description: >-
Discord Deno TypeScript API library wrapper(Officially vetted library by
Discord Team) https://discordeno.netlify.app
version: 9.0.10
version: 9.0.12
stable: true
entry: mod.ts
repository: 'https://github.com/Skillz4Killz/Discordeno'

View File

@@ -164,7 +164,12 @@ export async function sendMessage(
const channel = await cacheHandlers.get("channels", channelID);
if (!channel) throw new Error(Errors.CHANNEL_NOT_FOUND);
if (![ChannelTypes.DM, ChannelTypes.GUILD_NEWS, ChannelTypes.GUILD_TEXT].includes(channel.type)) throw new Error(Errors.CHANNEL_NOT_TEXT_BASED)
if (
![ChannelTypes.DM, ChannelTypes.GUILD_NEWS, ChannelTypes.GUILD_TEXT]
.includes(channel.type)
) {
throw new Error(Errors.CHANNEL_NOT_TEXT_BASED);
}
const result = await RequestManager.post(
endpoints.CHANNEL_MESSAGES(channelID),