mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
fix: use PermissionStrings
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import { cacheHandlers } from "../../cache.ts";
|
import { cacheHandlers } from "../../cache.ts";
|
||||||
import { RequestManager } from "../../rest/request_manager.ts";
|
import { RequestManager } from "../../rest/request_manager.ts";
|
||||||
import { structures } from "../../structures/mod.ts";
|
import { structures } from "../../structures/mod.ts";
|
||||||
|
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
|
||||||
|
import { PermissionStrings } from "../../types/mod.ts";
|
||||||
import { endpoints } from "../../util/constants.ts";
|
import { endpoints } from "../../util/constants.ts";
|
||||||
import { requireBotChannelPermissions } from "../../util/permissions.ts";
|
import { requireBotChannelPermissions } from "../../util/permissions.ts";
|
||||||
|
|
||||||
@@ -15,15 +17,15 @@ export async function sendMessage(
|
|||||||
if (channel) {
|
if (channel) {
|
||||||
if (
|
if (
|
||||||
![
|
![
|
||||||
ChannelTypes.DM,
|
DiscordChannelTypes.DM,
|
||||||
ChannelTypes.GUILD_NEWS,
|
DiscordChannelTypes.GUILD_NEWS,
|
||||||
ChannelTypes.GUILD_TEXT,
|
DiscordChannelTypes.GUILD_TEXT,
|
||||||
].includes(channel.type)
|
].includes(channel.type)
|
||||||
) {
|
) {
|
||||||
throw new Error(Errors.CHANNEL_NOT_TEXT_BASED);
|
throw new Error(Errors.CHANNEL_NOT_TEXT_BASED);
|
||||||
}
|
}
|
||||||
|
|
||||||
const requiredPerms: Set<Permission> = new Set([
|
const requiredPerms: Set<PermissionStrings> = new Set([
|
||||||
"SEND_MESSAGES",
|
"SEND_MESSAGES",
|
||||||
"VIEW_CHANNEL",
|
"VIEW_CHANNEL",
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user