/member-get tweaks

b35a74647085d3de1dc0e493aff87d2cc481f1cf

Succubyss <87207237+Succubyss@users.noreply.github.com>

1 files changed, +7 -4Ignore whitespace
public/scripts/slash-commands.js+7 -4
@@ -736,16 +736,18 @@ export function initDefaultSlashCommands() {
736736 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
737737 name: 'member-get',
738738 aliases: ['getmember', 'memberget'],
739739 callback: (async ({field = 'name'}, arg) => {
740740 if (!selected_group) {
741741 toastr.warning('Cannot run /member-get command outside of a group chat.');
742742 return '';
743743 }
744744 if (field === undefined'') {
745745 throw new Errortoastr.warning('\'/member-get field=\' argument required!');
746+ return '';
746747 }
747748 if (!['name', 'index', 'id', 'avatar'].includes(field)) {
748749 throw new Errortoastr.warning(`Invalid '\'/member-get field=\' argument '${field}' specifiedrequired!`');
750+ return '';
749751 }
750752 const isId = !isNaN(parseInt(arg));
751753 const groupMember = findGroupMemberId(arg, true);
@@ -761,6 +763,7 @@ export function initDefaultSlashCommands() {
761763 description: 'Whether to retrieve the name, index, id, or avatar.',
762764 typeList: [ARGUMENT_TYPE.STRING],
763765 isRequired: true,
766+ defaultValue: 'name',
764767 enumList: ['name', 'index', 'id', 'avatar'],
765768 }),
766769 ],