Comparing version 5.5.0-dev.1628959073 to 5.5.0-dev.1628963818
@@ -81,3 +81,3 @@ import { ApplicationCommand, Client as ClientJS, CommandInteraction, Interaction, Message, Snowflake } from "discord.js"; | ||
/** | ||
* @deprecated Use `initApplicationCommands` instead. | ||
* @deprecated Use `initApplicationCommands` instead. will be removed by end of auguest 2021. | ||
*/ | ||
@@ -100,2 +100,6 @@ initSlashes: (options?: { | ||
/** | ||
* @deprecated Use `fetchApplicationCommands` instead. will be removed by end of auguest 2021. | ||
*/ | ||
fetchSlash: (guildID?: string | undefined) => Promise<import("discord.js").Collection<string, ApplicationCommand<{}>> | undefined>; | ||
/** | ||
* Fetch the existing slash commands of a guild or globaly | ||
@@ -105,5 +109,5 @@ * @param guild The guild ID (empty -> globaly) | ||
*/ | ||
fetchSlash(guildID?: Snowflake): Promise<import("discord.js").Collection<string, ApplicationCommand<{}>> | undefined>; | ||
fetchApplicationCommands(guildID?: Snowflake): Promise<import("discord.js").Collection<string, ApplicationCommand<{}>> | undefined>; | ||
/** | ||
* @deprecated Use `clearApplicationCommands` instead. | ||
* @deprecated Use `clearApplicationCommands` instead. will be removed by end of auguest 2021. | ||
*/ | ||
@@ -110,0 +114,0 @@ clearSlashes: (...guilds: Snowflake[]) => Promise<void>; |
@@ -18,8 +18,12 @@ "use strict"; | ||
/** | ||
* @deprecated Use `initApplicationCommands` instead. | ||
* @deprecated Use `initApplicationCommands` instead. will be removed by end of auguest 2021. | ||
*/ | ||
this.initSlashes = this.initApplicationCommands; | ||
/** | ||
* @deprecated Use `clearApplicationCommands` instead. | ||
* @deprecated Use `fetchApplicationCommands` instead. will be removed by end of auguest 2021. | ||
*/ | ||
this.fetchSlash = this.fetchApplicationCommands; | ||
/** | ||
* @deprecated Use `clearApplicationCommands` instead. will be removed by end of auguest 2021. | ||
*/ | ||
this.clearSlashes = this.clearApplicationCommands; | ||
@@ -270,3 +274,3 @@ _1.MetadataStorage.classes = [ | ||
// # initialize add/update/delete task for global slashes | ||
const existing = (await this.fetchSlash())?.filter((s) => !s.guild); | ||
const existing = (await this.fetchApplicationCommands())?.filter((s) => !s.guild); | ||
const slashes = this.applicationCommands.filter((s) => !s.guilds?.length); | ||
@@ -306,3 +310,3 @@ if (existing) { | ||
*/ | ||
async fetchSlash(guildID) { | ||
async fetchApplicationCommands(guildID) { | ||
if (guildID) { | ||
@@ -325,3 +329,3 @@ const guild = this.guilds.cache.get(guildID); | ||
// Select and delete the commands of each guild | ||
const commands = await this.fetchSlash(guild); | ||
const commands = await this.fetchApplicationCommands(guild); | ||
if (commands && this.guilds.cache !== undefined) | ||
@@ -337,3 +341,3 @@ await Promise.all(commands.map(async (value) => { | ||
// Select and delete the commands of each guild | ||
const commands = await this.fetchSlash(); | ||
const commands = await this.fetchApplicationCommands(); | ||
if (commands) { | ||
@@ -340,0 +344,0 @@ await Promise.all(commands.map(async (value) => { |
{ | ||
"name": "discordx", | ||
"version": "5.5.0-dev.1628959073", | ||
"version": "5.5.0-dev.1628963818", | ||
"description": "Create your discord bot by using TypeScript and decorators!", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -42,3 +42,3 @@ <p align="center"> | ||
- added `@SimpleCommand` to support v4 commands | ||
- added new interactions: `@ButtonComponent @SelectMenuComponent` | ||
- added new interactions: `@ButtonComponent @SelectMenuComponent` `@ContextMenu` | ||
- added new decorator `@DefaultPermission` | ||
@@ -84,6 +84,4 @@ - added new initSlash method to create/update/remove slash commands | ||
- `@ButtonComponent` | ||
- `@SimpleCommand` | ||
- `@SimpleCommandOption` | ||
- `@DefaultPermission` | ||
- `@Description` | ||
- `@SelectMenuComponent` | ||
- `@ContextMenu` | ||
- `@Discord` | ||
@@ -94,4 +92,6 @@ - `@Guard` | ||
- `@Once` | ||
- `@DefaultPermission` | ||
- `@Permission` | ||
- `@SelectMenuComponent` | ||
- `@SimpleCommand` | ||
- `@SimpleCommandOption` | ||
- `@Slash` | ||
@@ -98,0 +98,0 @@ - `@SlashChoice` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
219525
3566