Use SlashCommandEnumValue
| @@ -745,6 +745,8 @@ export function initDefaultSlashCommands() { | |||
| 745 | toastr.warning('\'/member-get field=\' argument required!'); | 745 | toastr.warning('\'/member-get field=\' argument required!'); |
| 746 | return ''; | 746 | return ''; |
| 747 | } | 747 | } |
| 748 | field = field.toString(); | ||
| 749 | arg = arg.toString(); | ||
| 748 | if (!['name', 'index', 'id', 'avatar'].includes(field)) { | 750 | if (!['name', 'index', 'id', 'avatar'].includes(field)) { |
| 749 | toastr.warning('\'/member-get field=\' argument required!'); | 751 | toastr.warning('\'/member-get field=\' argument required!'); |
| 750 | return ''; | 752 | return ''; |
| @@ -764,7 +766,12 @@ export function initDefaultSlashCommands() { | |||
| 764 | typeList: [ARGUMENT_TYPE.STRING], | 766 | typeList: [ARGUMENT_TYPE.STRING], |
| 765 | isRequired: true, | 767 | isRequired: true, |
| 766 | defaultValue: 'name', | 768 | defaultValue: 'name', |
| 767 | enumList: ['name', 'index', 'id', 'avatar'], | 769 | enumList: [ |
| 770 | new SlashCommandEnumValue('name', 'Character name'), | ||
| 771 | new SlashCommandEnumValue('index', 'Group member index'), | ||
| 772 | new SlashCommandEnumValue('avatar', 'Character avatar'), | ||
| 773 | new SlashCommandEnumValue('id', 'Character index'), | ||
| 774 | ], | ||
| 768 | }), | 775 | }), |
| 769 | ], | 776 | ], |
| 770 | unnamedArgumentList: [ | 777 | unnamedArgumentList: [ |