Commit b79ecf6f authored by Rasmus Bengtsson's avatar Rasmus Bengtsson
Browse files

do not cle

parent ae9a2e48
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const discord_js_1 = require("discord.js");
// Use the Client that are provided by @typeit/discord NOT discord.js
const discord_1 = require("@typeit/discord");
async function start() {
const client = new discord_1.Client({
intents: [
discord_js_1.Intents.FLAGS.GUILDS,
discord_js_1.Intents.FLAGS.GUILD_MESSAGES,
],
classes: [
`${__dirname}/*Discord.ts`,
`${__dirname}/*Discord.js`, // If you compile using "tsc" the file extension change to .js
],
silent: false,
});
client.once("ready", async () => {
await client.clearSlashes();
await client.initSlashes();
});
client.on("interaction", (interaction) => {
console.log("an interaction has happened");
client.executeSlash(interaction);
});
await client.login("ODg2NjYzNDY2OTM5NzM2MTE2.YT43sw.N8AQPqwt5FEG6G5PCuBGE4eXitc");
}
start();
//# sourceMappingURL=main.js.map
\ No newline at end of file
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,4BAA0B;AAC1B,2CAAqC;AACrC,qEAAqE;AACrE,6CAAyC;AAEzC,KAAK,UAAU,KAAK;IAClB,MAAM,MAAM,GAAG,IAAI,gBAAM,CAAC;QACxB,OAAO,EAAE;YACP,oBAAO,CAAC,KAAK,CAAC,MAAM;YACpB,oBAAO,CAAC,KAAK,CAAC,cAAc;SAC7B;QACD,OAAO,EAAE;YACP,GAAG,SAAS,cAAc;YAC1B,GAAG,SAAS,cAAc,EAAE,8DAA8D;SAC3F;QACD,MAAM,EAAE,KAAK;KACd,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;QAC5B,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,EAAE;QACvC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAA;QAC1C,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;AACpF,CAAC;AAED,KAAK,EAAE,CAAC"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const discord_1 = require("@typeit/discord");
const discord_js_1 = require("discord.js");
let PingBot = class PingBot {
ping(interaction) {
console.log("I got triggred!");
console.log(interaction.toJSON);
interaction.reply("Pong!");
console.log("I Replys");
}
};
(0, tslib_1.__decorate)([
(0, discord_1.Slash)("ping"),
(0, discord_1.Description)("Ping Pong!"),
(0, tslib_1.__metadata)("design:type", Function),
(0, tslib_1.__metadata)("design:paramtypes", [discord_js_1.CommandInteraction]),
(0, tslib_1.__metadata)("design:returntype", void 0)
], PingBot.prototype, "ping", null);
PingBot = (0, tslib_1.__decorate)([
(0, discord_1.Discord)()
], PingBot);
//# sourceMappingURL=ping.Discord.js.map
\ No newline at end of file
{"version":3,"file":"ping.Discord.js","sourceRoot":"","sources":["../src/ping.Discord.ts"],"names":[],"mappings":";;;AAAA,6CAAsE;AACtE,2CAA+C;AAG/C,IAAe,OAAO,GAAtB,MAAe,OAAO;IAIV,IAAI,CACR,WAA+B;QAE/B,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;QAC9B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QAC/B,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAC3B,CAAC;CACJ,CAAA;AARG;IAFC,IAAA,eAAK,EAAC,MAAM,CAAC;IACb,IAAA,qBAAW,EAAC,YAAY,CAAC;;kDAET,+BAAkB;;mCAMlC;AAXU,OAAO;IADrB,IAAA,iBAAO,GAAE;GACK,OAAO,CAYrB"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const discord_1 = require("@typeit/discord");
const discord_js_1 = require("discord.js");
let PingBot = class PingBot {
ping(message, client) {
message.reply("Pong!");
}
};
(0, tslib_1.__decorate)([
(0, discord_1.Slash)("Ping"),
(0, tslib_1.__metadata)("design:type", Function),
(0, tslib_1.__metadata)("design:paramtypes", [discord_js_1.Message, discord_1.Client]),
(0, tslib_1.__metadata)("design:returntype", void 0)
], PingBot.prototype, "ping", null);
PingBot = (0, tslib_1.__decorate)([
(0, discord_1.Discord)()
], PingBot);
//# sourceMappingURL=ping.discord.js.map
\ No newline at end of file
{"version":3,"file":"ping.discord.js","sourceRoot":"","sources":["../src/ping.discord.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AACzD,2CAAoC;AAGpC,IAAe,OAAO,GAAtB,MAAe,OAAO;IAGV,IAAI,CAAC,OAAgB,EAAE,MAAc;QACzC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;CACJ,CAAA;AAHG;IADC,IAAA,eAAK,EAAC,MAAM,CAAC;;kDACQ,oBAAO,EAAU,gBAAM;;mCAE5C;AALU,OAAO;IADrB,IAAA,iBAAO,GAAE;GACK,OAAO,CAMrB"}
\ No newline at end of file
......@@ -6,9 +6,9 @@
"flags": [],
"linkedModules": [],
"topLevelPatterns": [
"@typeit/discord@^5.0.13",
"@typeit/discord@slash@^5.0.13",
"@types/node@^16.9.1",
"discord.js@^13.1.0",
"discord.js@https://github.com/discordjs/discord.js",
"reflect-metadata@^0.1.13",
"tslib@^2.3.1",
"typescript@^4.4.3"
......@@ -19,7 +19,7 @@
"@discordjs/form-data@^3.0.1": "https://registry.yarnpkg.com/@discordjs/form-data/-/form-data-3.0.1.tgz#5c9e6be992e2e57d0dfa0e39979a850225fb4697",
"@sapphire/async-queue@^1.1.4": "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.1.4.tgz#ae431310917a8880961cebe8e59df6ffa40f2957",
"@sindresorhus/is@^4.0.1": "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.1.0.tgz#3853c0c48b47f0ebcdd3cd9a66fdd0d277173e78",
"@typeit/discord@^5.0.13": "https://registry.yarnpkg.com/@typeit/discord/-/discord-5.0.13.tgz#a4cf6c1c4e8d3adddb23eba16b8adc8f5659dafd",
"@typeit/discord@slash@^5.0.13": "https://registry.yarnpkg.com/@typeit/discord/-/discord-5.0.13.tgz#a4cf6c1c4e8d3adddb23eba16b8adc8f5659dafd",
"@types/node@*": "https://registry.yarnpkg.com/@types/node/-/node-16.9.1.tgz#0611b37db4246c937feef529ddcc018cf8e35708",
"@types/node@^16.9.1": "https://registry.yarnpkg.com/@types/node/-/node-16.9.1.tgz#0611b37db4246c937feef529ddcc018cf8e35708",
"@types/ws@^7.4.7": "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702",
......@@ -32,8 +32,8 @@
"delayed-stream@~1.0.0": "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619",
"discord-api-types@^0.18.1": "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.18.1.tgz#5d08ed1263236be9c21a22065d0e6b51f790f492",
"discord-api-types@^0.22.0": "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.22.0.tgz#34dc57fe8e016e5eaac5e393646cd42a7e1ccc2a",
"discord.js@^13.1.0": "https://registry.yarnpkg.com/discord.js/-/discord.js-13.1.0.tgz#99f6a2a8be88d31906ff0148e9b1cb603ebb2e2e",
"discord.js@github:discordjs/discord.js": "https://codeload.github.com/discordjs/discord.js/tar.gz/be8912a4219d1c1aa59a8060707973e567b7b5a3",
"discord.js@https://github.com/discordjs/discord.js": "https://github.com/discordjs/discord.js#be8912a4219d1c1aa59a8060707973e567b7b5a3",
"dot-prop@^6.0.1": "https://registry.yarnpkg.com/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083",
"fs.realpath@^1.0.0": "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f",
"glob@^7.1.7": "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90",
......
This diff is collapsed.
{
"name": "discord.js",
"version": "13.1.0",
"version": "13.2.0-dev",
"description": "A powerful library for interacting with the Discord API",
"main": "./src/index.js",
"module": "./src/index.mjs",
......@@ -61,6 +61,7 @@
"@commitlint/cli": "^13.1.0",
"@commitlint/config-angular": "^13.1.0",
"@discordjs/docgen": "^0.10.0",
"@favware/npm-deprecate": "^1.0.2",
"@types/node": "^16.4.12",
"conventional-changelog-cli": "^2.1.1",
"cross-env": "^7.0.3",
......
......@@ -24,7 +24,7 @@ class BaseClient extends EventEmitter {
* @type {RESTManager}
* @private
*/
this.rest = new RESTManager(this, options._tokenType);
this.rest = new RESTManager(this);
}
/**
......
......@@ -35,7 +35,7 @@ class Client extends BaseClient {
* @param {ClientOptions} options Options for the client
*/
constructor(options) {
super(Object.assign({ _tokenType: 'Bot' }, options));
super(options);
const data = require('worker_threads').workerData ?? process.env;
const defaults = Options.createDefault();
......@@ -181,7 +181,7 @@ class Client extends BaseClient {
);
this.sweepMessageInterval = setInterval(
this.sweepMessages.bind(this),
this.options.messageSweepInterval * 1000,
this.options.messageSweepInterval * 1_000,
).unref();
}
}
......@@ -401,7 +401,7 @@ class Client extends BaseClient {
return -1;
}
const lifetimeMs = lifetime * 1000;
const lifetimeMs = lifetime * 1_000;
const now = Date.now();
let channels = 0;
let messages = 0;
......
......@@ -13,8 +13,11 @@ class MessageReactionRemoveAll extends Action {
const message = this.getMessage(data, channel);
if (!message) return false;
// Copy removed reactions to emit for the event.
const removed = message.reactions.cache.clone();
message.reactions.cache.clear();
this.client.emit(Events.MESSAGE_REACTION_REMOVE_ALL, message);
this.client.emit(Events.MESSAGE_REACTION_REMOVE_ALL, message, removed);
return { message };
}
......@@ -24,6 +27,7 @@ class MessageReactionRemoveAll extends Action {
* Emitted whenever all reactions are removed from a cached message.
* @event Client#messageReactionRemoveAll
* @param {Message} message The message the reactions were removed from
* @param {Collection<string|Snowflake, MessageReaction>} reactions The cached message reactions that were removed.
*/
module.exports = MessageReactionRemoveAll;
......@@ -7,7 +7,7 @@ class UserUpdateAction extends Action {
handle(data) {
const client = this.client;
const newUser = client.users.cache.get(data.id);
const newUser = data.id === client.user.id ? client.user : client.users.cache.get(data.id);
const oldUser = newUser._update(data);
if (!oldUser.equals(newUser)) {
......
......@@ -2,6 +2,7 @@
const EventEmitter = require('events');
const { Collection } = require('@discordjs/collection');
const { RPCErrorCodes } = require('discord-api-types/v9');
const WebSocketShard = require('./WebSocketShard');
const PacketHandlers = require('./handlers');
const { Error } = require('../../errors');
......@@ -19,7 +20,11 @@ const BeforeReadyWhitelist = [
];
const UNRECOVERABLE_CLOSE_CODES = Object.keys(WSCodes).slice(1).map(Number);
const UNRESUMABLE_CLOSE_CODES = [1000, 4006, 4007];
const UNRESUMABLE_CLOSE_CODES = [
RPCErrorCodes.UnknownError,
RPCErrorCodes.InvalidPermissions,
RPCErrorCodes.InvalidClientId,
];
/**
* The WebSocket manager for this client.
......@@ -184,7 +189,7 @@ class WebSocketManager extends EventEmitter {
});
shard.on(ShardEvents.CLOSE, event => {
if (event.code === 1000 ? this.destroyed : UNRECOVERABLE_CLOSE_CODES.includes(event.code)) {
if (event.code === 1_000 ? this.destroyed : UNRECOVERABLE_CLOSE_CODES.includes(event.code)) {
/**
* Emitted when a shard's WebSocket disconnects and will no longer reconnect.
* @event Client#shardDisconnect
......@@ -253,7 +258,7 @@ class WebSocketManager extends EventEmitter {
// If we have more shards, add a 5s delay
if (this.shardQueue.size) {
this.debug(`Shard Queue Size: ${this.shardQueue.size}; continuing in 5 seconds...`);
await Util.delayFor(5000);
await Util.delayFor(5_000);
return this.createShards();
}
......@@ -274,7 +279,7 @@ class WebSocketManager extends EventEmitter {
this.debug(`Couldn't reconnect or fetch information about the gateway. ${error}`);
if (error.httpStatus !== 401) {
this.debug(`Possible network error occurred. Retrying in 5s...`);
await Util.delayFor(5000);
await Util.delayFor(5_000);
this.reconnecting = false;
return this.reconnect();
}
......@@ -316,7 +321,7 @@ class WebSocketManager extends EventEmitter {
this.debug(`Manager was destroyed. Called by:\n${new Error('MANAGER_DESTROYED').stack}`);
this.destroyed = true;
this.shardQueue.clear();
for (const shard of this.shards.values()) shard.destroy({ closeCode: 1000, reset: true, emit: false, log: false });
for (const shard of this.shards.values()) shard.destroy({ closeCode: 1_000, reset: true, emit: false, log: false });
}
/**
......
......@@ -415,7 +415,7 @@ class WebSocketShard extends EventEmitter {
break;
case Opcodes.RECONNECT:
this.debug('[RECONNECT] Discord asked us to reconnect');
this.destroy({ closeCode: 4000 });
this.destroy({ closeCode: 4_000 });
break;
case Opcodes.INVALID_SESSION:
this.debug(`[INVALID SESSION] Resumable: ${packet.d}.`);
......@@ -489,7 +489,7 @@ class WebSocketShard extends EventEmitter {
this.emit(ShardEvents.ALL_READY, this.expectedGuilds);
},
hasGuildsIntent ? 15000 : 0,
hasGuildsIntent ? 15_000 : 0,
).unref();
}
......@@ -511,7 +511,7 @@ class WebSocketShard extends EventEmitter {
this.helloTimeout = setTimeout(() => {
this.debug('Did not receive HELLO in time. Destroying and connecting again.');
this.destroy({ reset: true, closeCode: 4009 });
}, 20000).unref();
}, 20_000).unref();
}
/**
......@@ -656,7 +656,7 @@ class WebSocketShard extends EventEmitter {
_send(data) {
if (this.connection?.readyState !== WebSocket.OPEN) {
this.debug(`Tried to send packet '${JSON.stringify(data)}' but no WebSocket is available!`);
this.destroy({ closeCode: 4000 });
this.destroy({ closeCode: 4_000 });
return;
}
......@@ -692,7 +692,7 @@ class WebSocketShard extends EventEmitter {
* @param {Object} [options={ closeCode: 1000, reset: false, emit: true, log: true }] Options for destroying the shard
* @private
*/
destroy({ closeCode = 1000, reset = false, emit = true, log = true } = {}) {
destroy({ closeCode = 1_000, reset = false, emit = true, log = true } = {}) {
if (log) {
this.debug(`[DESTROY]
Close Code : ${closeCode}
......
......@@ -99,10 +99,12 @@ const Messages = {
MESSAGE_THREAD_PARENT: 'The message was not sent in a guild text or news channel',
MESSAGE_EXISTING_THREAD: 'The message already has a thread',
THREAD_INVITABLE_TYPE: type => `Invitable cannot be edited on ${type}`,
WEBHOOK_MESSAGE: 'The message was not sent by a webhook.',
WEBHOOK_TOKEN_UNAVAILABLE: 'This action requires a webhook token, but none is available.',
WEBHOOK_URL_INVALID: 'The provided webhook URL is not valid.',
WEBHOOK_APPLICATION: 'This message webhook belongs to an application and cannot be fetched.',
MESSAGE_REFERENCE_MISSING: 'The message does not reference another message',
EMOJI_TYPE: 'Emoji must be a string or GuildEmoji/ReactionEmoji',
......@@ -131,8 +133,7 @@ const Messages = {
INTERACTION_ALREADY_REPLIED: 'The reply to this interaction has already been sent or deferred.',
INTERACTION_NOT_REPLIED: 'The reply to this interaction has not been sent or deferred.',
INTERACTION_EPHEMERAL_REPLIED: 'Ephemeral responses cannot be fetched or deleted.',
INTERACTION_FETCH_EPHEMERAL: 'Ephemeral responses cannot be fetched.',
INTERACTION_EPHEMERAL_REPLIED: 'Ephemeral responses cannot be deleted.',
COMMAND_INTERACTION_OPTION_NOT_FOUND: name => `Required option "${name}" not found.`,
COMMAND_INTERACTION_OPTION_TYPE: (name, type, expected) =>
......
......@@ -71,8 +71,10 @@ module.exports = {
Application: require('./structures/interfaces/Application'),
ApplicationCommand: require('./structures/ApplicationCommand'),
Base: require('./structures/Base'),
BaseCommandInteraction: require('./structures/BaseCommandInteraction'),
BaseGuild: require('./structures/BaseGuild'),
BaseGuildEmoji: require('./structures/BaseGuildEmoji'),
BaseGuildTextChannel: require('./structures/BaseGuildTextChannel'),
BaseGuildVoiceChannel: require('./structures/BaseGuildVoiceChannel'),
BaseMessageComponent: require('./structures/BaseMessageComponent'),
ButtonInteraction: require('./structures/ButtonInteraction'),
......@@ -84,6 +86,7 @@ module.exports = {
Collector: require('./structures/interfaces/Collector'),
CommandInteraction: require('./structures/CommandInteraction'),
CommandInteractionOptionResolver: require('./structures/CommandInteractionOptionResolver'),
ContextMenuInteraction: require('./structures/ContextMenuInteraction'),
DMChannel: require('./structures/DMChannel'),
Emoji: require('./structures/Emoji'),
Guild: require('./structures/Guild'),
......
import mod from "./index.js";
export default mod;
export const Activity = mod.Activity;
export const ActivityFlags = mod.ActivityFlags;
export const AnonymousGuild = mod.AnonymousGuild;
export const Application = mod.Application;
export const ApplicationCommand = mod.ApplicationCommand;
export const ApplicationCommandManager = mod.ApplicationCommandManager;
export const ApplicationCommandPermissionsManager = mod.ApplicationCommandPermissionsManager;
export const ApplicationFlags = mod.ApplicationFlags;
export const Base = mod.Base;
export const BaseClient = mod.BaseClient;
export const BaseGuild = mod.BaseGuild;
export const BaseGuildEmoji = mod.BaseGuildEmoji;
export const BaseGuildEmojiManager = mod.BaseGuildEmojiManager;
export const BaseGuildVoiceChannel = mod.BaseGuildVoiceChannel;
export const BaseManager = mod.BaseManager;
export const BaseMessageComponent = mod.BaseMessageComponent;
export const BitField = mod.BitField;
export const ButtonInteraction = mod.ButtonInteraction;
export const CachedManager = mod.CachedManager;
export const CategoryChannel = mod.CategoryChannel;
export const Channel = mod.Channel;
export const ChannelManager = mod.ChannelManager;
export const Client = mod.Client;
export const ClientApplication = mod.ClientApplication;
export const ClientPresence = mod.ClientPresence;
export const ClientUser = mod.ClientUser;
export const ClientVoiceManager = mod.ClientVoiceManager;
export const Collection = mod.Collection;
export const Collector = mod.Collector;
export const CommandInteraction = mod.CommandInteraction;
export const CommandInteractionOptionResolver = mod.CommandInteractionOptionResolver;
export const Constants = mod.Constants;
export const DMChannel = mod.DMChannel;
export const DataManager = mod.DataManager;
export const DataResolver = mod.DataResolver;
export const DiscordAPIError = mod.DiscordAPIError;
export const Emoji = mod.Emoji;
export const Formatters = mod.Formatters;
export const Guild = mod.Guild;
export const GuildApplicationCommandManager = mod.GuildApplicationCommandManager;
export const GuildAuditLogs = mod.GuildAuditLogs;
export const GuildAuditLogsEntry = mod.GuildAuditLogsEntry;
export const GuildBan = mod.GuildBan;
export const GuildBanManager = mod.GuildBanManager;
export const GuildChannel = mod.GuildChannel;
export const GuildChannelManager = mod.GuildChannelManager;
export const GuildEmoji = mod.GuildEmoji;
export const GuildEmojiManager = mod.GuildEmojiManager;
export const GuildEmojiRoleManager = mod.GuildEmojiRoleManager;
export const GuildInviteManager = mod.GuildInviteManager;
export const GuildManager = mod.GuildManager;
export const GuildMember = mod.GuildMember;
export const GuildMemberManager = mod.GuildMemberManager;
export const GuildMemberRoleManager = mod.GuildMemberRoleManager;
export const GuildPreview = mod.GuildPreview;
export const GuildPreviewEmoji = mod.GuildPreviewEmoji;
export const GuildStickerManager = mod.GuildStickerManager;
export const GuildTemplate = mod.GuildTemplate;
export const HTTPError = mod.HTTPError;
export const Integration = mod.Integration;
export const IntegrationApplication = mod.IntegrationApplication;
export const Intents = mod.Intents;
export const Interaction = mod.Interaction;
export const InteractionCollector = mod.InteractionCollector;
export const InteractionWebhook = mod.InteractionWebhook;
export const Invite = mod.Invite;
export const InviteGuild = mod.InviteGuild;
export const InviteStageInstance = mod.InviteStageInstance;
export const LimitedCollection = mod.LimitedCollection;
export const Message = mod.Message;
export const MessageActionRow = mod.MessageActionRow;
export const MessageAttachment = mod.MessageAttachment;
export const MessageButton = mod.MessageButton;
export const MessageCollector = mod.MessageCollector;
export const MessageComponentInteraction = mod.MessageComponentInteraction;
export const MessageEmbed = mod.MessageEmbed;
export const MessageFlags = mod.MessageFlags;
export const MessageManager = mod.MessageManager;
export const MessageMentions = mod.MessageMentions;
export const MessagePayload = mod.MessagePayload;
export const MessageReaction = mod.MessageReaction;
export const MessageSelectMenu = mod.MessageSelectMenu;
export const NewsChannel = mod.NewsChannel;
export const OAuth2Guild = mod.OAuth2Guild;
export const Options = mod.Options;
export const PartialGroupDMChannel = mod.PartialGroupDMChannel;
export const PermissionOverwriteManager = mod.PermissionOverwriteManager;
export const PermissionOverwrites = mod.PermissionOverwrites;
export const Permissions = mod.Permissions;
export const Presence = mod.Presence;
export const PresenceManager = mod.PresenceManager;
export const RateLimitError = mod.RateLimitError;
export const ReactionCollector = mod.ReactionCollector;
export const ReactionEmoji = mod.ReactionEmoji;
export const ReactionManager = mod.ReactionManager;
export const ReactionUserManager = mod.ReactionUserManager;
export const RichPresenceAssets = mod.RichPresenceAssets;
export const Role = mod.Role;
export const RoleManager = mod.RoleManager;
export const SelectMenuInteraction = mod.SelectMenuInteraction;
export const Shard = mod.Shard;
export const ShardClientUtil = mod.ShardClientUtil;
export const ShardingManager = mod.ShardingManager;
export const SnowflakeUtil = mod.SnowflakeUtil;
export const StageChannel = mod.StageChannel;
export const StageInstance = mod.StageInstance;
export const StageInstanceManager = mod.StageInstanceManager;
export const Sticker = mod.Sticker;
export const StickerPack = mod.StickerPack;
export const StoreChannel = mod.StoreChannel;
export const SystemChannelFlags = mod.SystemChannelFlags;
export const Team = mod.Team;
export const TeamMember = mod.TeamMember;
export const TextChannel = mod.TextChannel;
export const ThreadChannel = mod.ThreadChannel;
export const ThreadManager = mod.ThreadManager;
export const ThreadMember = mod.ThreadMember;
export const ThreadMemberFlags = mod.ThreadMemberFlags;
export const ThreadMemberManager = mod.ThreadMemberManager;
export const Typing = mod.Typing;
export const User = mod.User;
export const UserFlags = mod.UserFlags;
export const UserManager = mod.UserManager;
export const Util = mod.Util;
export const VoiceChannel = mod.VoiceChannel;
export const VoiceRegion = mod.VoiceRegion;
export const VoiceState = mod.VoiceState;
export const VoiceStateManager = mod.VoiceStateManager;
export const WebSocket = mod.WebSocket;
export const WebSocketManager = mod.WebSocketManager;
export const WebSocketShard = mod.WebSocketShard;
export const Webhook = mod.Webhook;
export const WebhookClient = mod.WebhookClient;
export const WelcomeChannel = mod.WelcomeChannel;
export const WelcomeScreen = mod.WelcomeScreen;
export const Widget = mod.Widget;
export const WidgetMember = mod.WidgetMember;
export const version = mod.version;
......@@ -380,9 +380,7 @@ class ApplicationCommandPermissionsManager extends BaseManager {
if (!commandId && this.guild) {
commandId = this.guild.commands.resolveId(command);
}
if (!commandId) {
commandId = this.client.application?.commands.resolveId(command);
}
commandId ??= this.client.application?.commands.resolveId(command);
if (!commandId) {
throw new TypeError('INVALID_TYPE', 'command', 'ApplicationCommandResolvable', true);
}
......
......@@ -94,8 +94,7 @@ class GuildChannelManager extends CachedManager {
/**
* Options used to create a new channel in a guild.
* @typedef {Object} GuildChannelCreateOptions
* @property {string|number} [type='GUILD_TEXT'] The type of the new channel, either `GUILD_TEXT`, `GUILD_VOICE`,
* `GUILD_CATEGORY`, `GUILD_NEWS`, `GUILD_STORE`, or `GUILD_STAGE_VOICE`
* @property {ChannelType|number} [type='GUILD_TEXT'] The type of the new channel.
* @property {string} [topic] The topic for the new channel
* @property {boolean} [nsfw] Whether the new channel is nsfw
* @property {number} [bitrate] Bitrate of the new channel in bits (only voice)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment