mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-30 15:30:07 +00:00
fix changes
This commit is contained in:
@@ -37,7 +37,7 @@ export async function handleChannelDelete(data: DiscordGatewayPayload) {
|
||||
if (
|
||||
[
|
||||
DiscordChannelTypes.GuildText,
|
||||
DiscordChannelTypes.Dm,
|
||||
DiscordChannelTypes.DM,
|
||||
DiscordChannelTypes.GroupDm,
|
||||
DiscordChannelTypes.GuildNews,
|
||||
].includes(payload.type)
|
||||
|
||||
@@ -14,7 +14,7 @@ export async function cloneChannel(channelId: bigint, reason?: string) {
|
||||
|
||||
//Check for DM channel
|
||||
if (
|
||||
channelToClone.type === DiscordChannelTypes.Dm ||
|
||||
channelToClone.type === DiscordChannelTypes.DM ||
|
||||
channelToClone.type === DiscordChannelTypes.GroupDm
|
||||
) {
|
||||
throw new Error(Errors.CHANNEL_NOT_IN_GUILD);
|
||||
|
||||
@@ -16,7 +16,7 @@ export async function startTyping(channelId: bigint) {
|
||||
if (channel) {
|
||||
if (
|
||||
![
|
||||
DiscordChannelTypes.Dm,
|
||||
DiscordChannelTypes.DM,
|
||||
DiscordChannelTypes.GuildNews,
|
||||
DiscordChannelTypes.GuildText,
|
||||
DiscordChannelTypes.GuildNewsThread,
|
||||
|
||||
@@ -24,7 +24,7 @@ export function fetchMembers(
|
||||
// You can request 1 member without the intent
|
||||
if (
|
||||
(!options?.limit || options.limit > 1) &&
|
||||
!(ws.identifyPayload.intents & DiscordGatewayIntents.GUILD_MEMBERS)
|
||||
!(ws.identifyPayload.intents & DiscordGatewayIntents.GuildMembers)
|
||||
) {
|
||||
throw new Error(Errors.MISSING_INTENT_GUILD_MEMBERS);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ export async function getMembers(
|
||||
guildId: bigint,
|
||||
options?: ListGuildMembers & { addToCache?: boolean },
|
||||
) {
|
||||
if (!(ws.identifyPayload.intents && DiscordGatewayIntents.GUILD_MEMBERS)) {
|
||||
if (!(ws.identifyPayload.intents && DiscordGatewayIntents.GuildMembers)) {
|
||||
throw new Error(Errors.MISSING_INTENT_GUILD_MEMBERS);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ export async function sendMessage(
|
||||
if (channel) {
|
||||
if (
|
||||
![
|
||||
DiscordChannelTypes.Dm,
|
||||
DiscordChannelTypes.DM,
|
||||
DiscordChannelTypes.GuildNews,
|
||||
DiscordChannelTypes.GuildText,
|
||||
DiscordChannelTypes.GuildPublicThread,
|
||||
|
||||
@@ -92,10 +92,10 @@ const baseGuild: Partial<DiscordenoGuild> = {
|
||||
return cache.members.get(this.ownerId!);
|
||||
},
|
||||
get partnered() {
|
||||
return Boolean(this.features?.includes(DiscordGuildFeatures.PARTNERED));
|
||||
return Boolean(this.features?.includes(DiscordGuildFeatures.Partnered));
|
||||
},
|
||||
get verified() {
|
||||
return Boolean(this.features?.includes(DiscordGuildFeatures.VERIFIED));
|
||||
return Boolean(this.features?.includes(DiscordGuildFeatures.Verified));
|
||||
},
|
||||
bannerURL(size, format) {
|
||||
return guildBannerURL(this.id!, this.banner!, size, format);
|
||||
|
||||
@@ -3,7 +3,7 @@ export enum DiscordChannelTypes {
|
||||
/** A text channel within a server */
|
||||
GuildText,
|
||||
/** A direct message between users */
|
||||
Dm,
|
||||
DM,
|
||||
/** A voice channel within a server */
|
||||
GuildVoice,
|
||||
/** A direct message between multiple users */
|
||||
|
||||
@@ -130,11 +130,11 @@ function validateSlashOptionChoices(
|
||||
}
|
||||
|
||||
if (
|
||||
(optionType === DiscordApplicationCommandOptionTypes.STRING &&
|
||||
(optionType === DiscordApplicationCommandOptionTypes.String &&
|
||||
(typeof choice.value !== "string" ||
|
||||
choice.value.length < 1 ||
|
||||
choice.value.length > 100)) ||
|
||||
(optionType === DiscordApplicationCommandOptionTypes.INTEGER &&
|
||||
(optionType === DiscordApplicationCommandOptionTypes.Integer &&
|
||||
typeof choice.value !== "number")
|
||||
) {
|
||||
throw new Error(Errors.INVALID_SLASH_OPTIONS_CHOICES);
|
||||
@@ -152,8 +152,8 @@ function validateSlashOptions(options: ApplicationCommandOption[]) {
|
||||
if (
|
||||
option.choices?.length &&
|
||||
(option.choices.length > 25 ||
|
||||
(option.type !== DiscordApplicationCommandOptionTypes.STRING &&
|
||||
option.type !== DiscordApplicationCommandOptionTypes.INTEGER))
|
||||
(option.type !== DiscordApplicationCommandOptionTypes.String &&
|
||||
option.type !== DiscordApplicationCommandOptionTypes.Integer))
|
||||
) {
|
||||
throw new Error(Errors.INVALID_SLASH_OPTIONS_CHOICES);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ Deno.test({
|
||||
permissionOverwrites: [
|
||||
{
|
||||
id: bigintToSnowflake(botId),
|
||||
type: DiscordOverwriteTypes.MEMBER,
|
||||
type: DiscordOverwriteTypes.Member,
|
||||
allow: ["VIEW_CHANNEL"],
|
||||
deny: [],
|
||||
},
|
||||
|
||||
@@ -141,7 +141,7 @@ Deno.test({
|
||||
permissionOverwrites: [
|
||||
{
|
||||
id: bigintToSnowflake(botId),
|
||||
type: DiscordOverwriteTypes.MEMBER,
|
||||
type: DiscordOverwriteTypes.Member,
|
||||
allow: ["VIEW_CHANNEL"],
|
||||
deny: [],
|
||||
},
|
||||
|
||||
@@ -160,7 +160,7 @@ Deno.test({
|
||||
permissionOverwrites: [
|
||||
{
|
||||
id: bigintToSnowflake(botId),
|
||||
type: DiscordOverwriteTypes.MEMBER,
|
||||
type: DiscordOverwriteTypes.Member,
|
||||
allow: ["VIEW_CHANNEL"],
|
||||
deny: [],
|
||||
},
|
||||
|
||||
@@ -56,7 +56,7 @@ Deno.test({
|
||||
permissionOverwrites: [
|
||||
{
|
||||
id: bigintToSnowflake(botId),
|
||||
type: DiscordOverwriteTypes.MEMBER,
|
||||
type: DiscordOverwriteTypes.Member,
|
||||
allow: ["VIEW_CHANNEL"],
|
||||
deny: [],
|
||||
},
|
||||
|
||||
@@ -35,7 +35,7 @@ async function ifItFailsBlameWolf(options: CreateGuildChannel) {
|
||||
}
|
||||
|
||||
await editChannelOverwrite(channel.guildId, channel.id, botId, {
|
||||
type: DiscordOverwriteTypes.MEMBER,
|
||||
type: DiscordOverwriteTypes.Member,
|
||||
allow: ["VIEW_CHANNEL", "ADD_REACTIONS"],
|
||||
deny: [],
|
||||
});
|
||||
@@ -71,7 +71,7 @@ Deno.test({
|
||||
permissionOverwrites: [
|
||||
{
|
||||
id: bigintToSnowflake(botId),
|
||||
type: DiscordOverwriteTypes.MEMBER,
|
||||
type: DiscordOverwriteTypes.Member,
|
||||
allow: ["VIEW_CHANNEL"],
|
||||
deny: [],
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@ Deno.test({
|
||||
permissionOverwrites: [
|
||||
{
|
||||
id: bigintToSnowflake(botId),
|
||||
type: DiscordOverwriteTypes.MEMBER,
|
||||
type: DiscordOverwriteTypes.Member,
|
||||
allow: ["VIEW_CHANNEL"],
|
||||
deny: [],
|
||||
},
|
||||
|
||||
@@ -36,11 +36,10 @@ Deno.test({
|
||||
await startBot({
|
||||
token,
|
||||
intents: [
|
||||
"GUILD_MESSAGES",
|
||||
"GUILDS",
|
||||
"GUILD_EMOJIS",
|
||||
"GUILD_MESSAGE_REACTIONS",
|
||||
"GUILD_EMOJIS",
|
||||
"GuildMessages",
|
||||
"Guilds",
|
||||
"GuildEmojis",
|
||||
"GuildMessageReactions",
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user