Blame Raw
Cohee · e3f41666 · · 35 lines (786 B)
1 contributor
1import { SlashCommand } from './SlashCommand.js';
2import { AutoCompleteOption } from '../autocomplete/AutoCompleteOption.js';
3
4export class SlashCommandCommandAutoCompleteOption extends AutoCompleteOption {
5 /**@type {SlashCommand}*/ command;
6
7
8 get value() {
9 return this.command;
10 }
11
12
13 /**
14 * @param {SlashCommand} command
15 * @param {string} name
16 */
17 constructor(command, name) {
18 super(name);
19 this.command = command;
20 }
21
22
23 renderItem() {
24 let li;
25 li = this.command.renderHelpItem(this.name);
26 li.setAttribute('data-name', this.name);
27 li.setAttribute('data-option-type', 'command');
28 return li;
29 }
30
31
32 renderDetails() {
33 return this.command.renderHelpDetails(this.name);
34 }
35}