@@ -9,7 +9,7 @@ const msRcConfig = config.messageScan?.humanCorrections?.allow
99
1010export default new Command ( {
1111 name : 'train' ,
12- description : 'Train a specific message to a specific label' ,
12+ description : 'Train a specific message or text to a specific label' ,
1313 type : Command . Type . ChatGuild ,
1414 requirements : {
1515 users : msRcConfig ?. users ,
@@ -26,9 +26,9 @@ export default new Command({
2626 required : true ,
2727 } ,
2828 label : {
29- description : 'The label to train the message as (leave empty for out of scope) ' ,
29+ description : 'The label to train the message as' ,
3030 type : Command . OptionType . String ,
31- required : false ,
31+ required : true ,
3232 } ,
3333 } ,
3434 allowMessageCommand : true ,
@@ -49,7 +49,7 @@ export default new Command({
4949 'This command can only be used in or on text channels' ,
5050 )
5151
52- if ( label && ! labels . includes ( label ) )
52+ if ( ! labels . includes ( label ) )
5353 throw new CommandError (
5454 CommandErrorType . InvalidArgument ,
5555 `The provided label is invalid.\nValid labels are:${ labels . map ( l => `\n- \`${ l } \`` ) . join ( '' ) } ` ,
@@ -60,14 +60,14 @@ export default new Command({
6060 )
6161 if ( ! refMsg ) throw new CommandError ( CommandErrorType . InvalidArgument , 'The provided message does not exist.' )
6262
63- logger . debug ( `User ${ context . executor . id } is training message ${ refMsg ?. id } as ${ label ?? 'out of scope' } ` )
63+ logger . debug ( `User ${ context . executor . id } is training message ${ refMsg ?. id } as ${ label } ` )
6464
6565 await context . api . client . trainMessage ( refMsg . content , label )
6666 await trigger . reply ( {
6767 embeds : [
6868 createSuccessEmbed (
6969 'Message trained' ,
70- `The provided message has been trained as ${ label ? ` \`${ label } \`` : 'out of scope' } . Thank you for your contribution!` ,
70+ `The provided message has been trained as \`${ label } \`. Thank you for your contribution!` ,
7171 ) ,
7272 ] ,
7373 flags : MessageFlags . Ephemeral ,
0 commit comments