@wilcosp/rex
Version:
Rex is an automated command manager for discord js
28 lines (27 loc) • 945 B
JavaScript
/*!
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { RexInteractionBase } from "../interactionBase.js";
import { RexSlashInteractionOptionsResolver } from "./optionsResolver.js";
export class RexAutoCompleteInteraction extends RexInteractionBase {
constructor(inter) {
super(inter);
this.options = new RexSlashInteractionOptionsResolver(this.inter.options);
}
get responded() {
return this.inter.responded;
}
respond(...choices) {
return this.inter.respond(choices.flat().slice(0, 25));
}
respondNormalized(...choices) {
return this.inter.respond(choices
.flat()
.map(i => {
return { value: i.toString(), name: i.toString() };
})
.slice(0, 25));
}
}