File tree Expand file tree Collapse file tree 6 files changed +6
-18
lines changed
ai-assistant/src/commands Expand file tree Collapse file tree 6 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,7 @@ export class AskCommand implements ISlashCommand {
7272 http : IHttp
7373 ) : Promise < void > {
7474 const query = context . getArguments ( ) . join ( " " ) ;
75- if ( ! query ) {
76- throw new Error ( "Error!" ) ;
77- }
75+ if ( ! query ) return ;
7876
7977 const sendEditedMessage = await handleCommandResponse (
8078 query ,
Original file line number Diff line number Diff line change @@ -34,9 +34,7 @@ export class DevDocsCommand implements ISlashCommand {
3434 http : IHttp
3535 ) : Promise < void > {
3636 const query = context . getArguments ( ) . join ( " " ) ;
37- if ( ! query ) {
38- throw new Error ( "Error!" ) ;
39- }
37+ if ( ! query ) return ;
4038
4139 const sendEditedMessage = await handleCommandResponse (
4240 query ,
Original file line number Diff line number Diff line change @@ -85,9 +85,7 @@ export class DiagramCommand implements ISlashCommand {
8585 http : IHttp
8686 ) : Promise < void > {
8787 const query = context . getArguments ( ) . join ( " " ) ;
88- if ( ! query ) {
89- throw new Error ( "Error!" ) ;
90- }
88+ if ( ! query ) return ;
9189
9290 const sendEditedMessage = await handleCommandResponse (
9391 query ,
Original file line number Diff line number Diff line change @@ -86,9 +86,7 @@ export class DocumentCommand implements ISlashCommand {
8686 http : IHttp
8787 ) : Promise < void > {
8888 const query = context . getArguments ( ) . join ( " " ) ;
89- if ( ! query ) {
90- throw new Error ( "Error!" ) ;
91- }
89+ if ( ! query ) return ;
9290
9391 const sendEditedMessage = await handleCommandResponse (
9492 query ,
Original file line number Diff line number Diff line change @@ -129,9 +129,7 @@ export class ImportanceCommand implements ISlashCommand {
129129 http : IHttp
130130 ) : Promise < void > {
131131 const [ query ] = context . getArguments ( ) ;
132- if ( ! query ) {
133- throw new Error ( "Error!" ) ;
134- }
132+ if ( ! query ) return ;
135133
136134 const sendEditedMessage = await handleCommandResponse (
137135 query ,
Original file line number Diff line number Diff line change @@ -110,9 +110,7 @@ export class WhyUsedCommand implements ISlashCommand {
110110 http : IHttp
111111 ) : Promise < void > {
112112 const [ query ] = context . getArguments ( ) ;
113- if ( ! query ) {
114- throw new Error ( "Error!" ) ;
115- }
113+ if ( ! query ) return ;
116114
117115 const sendEditedMessage = await handleCommandResponse (
118116 query ,
You can’t perform that action at this time.
0 commit comments