| 2122 | 2122 | SlashCommandParser.addCommandObject(SlashCommand.fromProps({ |
| 2123 | 2123 | name: 'classify-expressions', |
| 2124 | 2124 | aliases: ['expressions'], |
| 2125 | 2125 | callback: async (args) => (await getExpressionsList()).join(', '),{ |
| 2126 | + const list = await getExpressionsList(); |
| 2127 | + switch (String(args.format).toLowerCase()) { |
| 2128 | + case 'json': |
| 2129 | + return JSON.stringify(list); |
| 2130 | + default: |
| 2131 | + return list.join(', '); |
| 2132 | + } |
| 2133 | + }, |
| 2134 | + namedArgumentList: [ |
| 2135 | + SlashCommandNamedArgument.fromProps({ |
| 2136 | + name: 'format', |
| 2137 | + description: 'The format to return the list in: comma-separated plain text or JSON array. Default is plain text.', |
| 2138 | + typeList: [ARGUMENT_TYPE.STRING], |
| 2139 | + enumList: [ |
| 2140 | + new SlashCommandEnumValue('plain', null, enumTypes.enum, ', '), |
| 2141 | + new SlashCommandEnumValue('json', null, enumTypes.enum, '[]'), |
| 2142 | + ], |
| 2143 | + }), |
| 2144 | + ], |
| 2126 | 2145 | returns: 'The comma-separated list of available expressions, including custom expressions.', |
| 2127 | 2146 | helpString: 'Returns a list of available expressions, including custom expressions.', |
| 2128 | 2147 | })); |