mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
@@ -1,19 +0,0 @@
|
||||
const { ArgumentType } = require('discord.js-commando');
|
||||
const { list } = require('../util/Util');
|
||||
|
||||
class ChoiceArgumentType extends ArgumentType {
|
||||
constructor(client) {
|
||||
super(client, 'choice');
|
||||
}
|
||||
|
||||
validate(value, msg, arg) {
|
||||
if (arg.choices.includes(value.toLowerCase())) return true;
|
||||
return `Invalid ${arg.label}, please enter either ${list(arg.choices, 'or')}.`;
|
||||
}
|
||||
|
||||
parse(value) {
|
||||
return value.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ChoiceArgumentType;
|
||||
Reference in New Issue
Block a user