Skip to content

Commit

Permalink
chore(#70): update discordx to v11.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
barthofu committed Sep 15, 2022
1 parent 2ad3808 commit 4b39269
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
31 changes: 20 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"discord-logs": "^2.2.1",
"discord-oauth2": "^2.10.0",
"discord.js": "^14.0.3",
"discordx": "^11.1.8",
"discordx": "^11.2.0",
"dotenv": "^16.0.1",
"fast-folder-size": "^1.7.0",
"fs": "^0.0.1-security",
Expand Down
5 changes: 3 additions & 2 deletions src/utils/decorators/On.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { EventOptions, MethodDecoratorEx, DOn, MetadataStorage } from 'discordx'
*
* @category Decorator
*/
export const On = (event: string, options?: EventOptions): MethodDecoratorEx => {
export const On = (event: string, options?: Omit<EventOptions, 'event'>): MethodDecoratorEx => {

return function <T>(
target: Record<string, T>,
Expand All @@ -23,7 +23,8 @@ export const On = (event: string, options?: EventOptions): MethodDecoratorEx =>
botIds: options?.botIds,
event: event,
once: false,
rest: false
rest: false,
priority: options?.priority,
}).decorate(clazz.constructor, key, descriptor?.value)

MetadataStorage.instance.addOn(on)
Expand Down
5 changes: 4 additions & 1 deletion src/utils/decorators/Slash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import { constantPreserveDots, sanitizeLocales, setOptionsLocalization } from '@
*
* @category Decorator
*/
export const Slash = (options: ApplicationCommandOptions = {}) => {
export const Slash = (options?: ApplicationCommandOptions | string) => {

if (!options) options = {}
else if (typeof options === 'string') options = { name: options }

let localizationSource: TranslationsNestedPaths | null = null

Expand Down

0 comments on commit 4b39269

Please sign in to comment.