generated from nyameliaaaa-archives/Nyameliaaaa_ts-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d7d132
commit 40a67d5
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ContextMenuCommandBuilder as Builder, ContextMenuCommandType } from '@discordjs/builders'; | ||
import { getDefaultString, joinKeys, getAllStrings } from 'index'; | ||
import { BaseKeyMixin } from 'mixins/base'; | ||
import { PermsV2Mixin, SharedOptionsMixin } from 'mixins/commands'; | ||
import { NameMixin } from 'mixins/nameAndDescription'; | ||
import { mix } from 'ts-mixer'; | ||
|
||
export interface ContextMenuCommandBuilder extends PermsV2Mixin<Builder>, NameMixin<Builder>, BaseKeyMixin {} | ||
|
||
@mix(PermsV2Mixin, NameMixin, BaseKeyMixin) | ||
export class ContextMenuCommandBuilder { | ||
// eslint-disable-next-line | ||
constructor(baseKey?: string) { | ||
this.builder = new Builder(); | ||
} | ||
|
||
protected init(baseKey?: string) { | ||
if (baseKey) { | ||
this.setName(getDefaultString(joinKeys([baseKey, 'context']), 'commands')); | ||
this.setNameLocalizations(getAllStrings(joinKeys([baseKey, 'context']), 'commands')); | ||
} | ||
} | ||
|
||
setType(type: ContextMenuCommandType) { | ||
this.builder.setType(type); | ||
return this; | ||
} | ||
} |