2
2
using Slack_GPT_Socket . GptApi . ParameterResolvers ;
3
3
using Slack_GPT_Socket . Settings ;
4
4
using Slack_GPT_Socket . Utilities . LiteDB ;
5
+ using SlackNet ;
5
6
using SlackNet . Interaction ;
7
+ using ILogger = Microsoft . Extensions . Logging . ILogger ;
6
8
7
9
namespace Slack_GPT_Socket . Command ;
8
10
@@ -13,20 +15,29 @@ public class CommandManager
13
15
/// <summary>
14
16
/// Initializes the command manager.
15
17
/// </summary>
18
+ /// <param name="slackSettings"></param>
16
19
/// <param name="customCommands"></param>
17
20
/// <param name="botInfo"></param>
18
21
/// <param name="userCommandDb"></param>
19
22
/// <param name="gptDefaults"></param>
20
23
/// <param name="log"></param>
24
+ /// <param name="slackApiClient"></param>
25
+ /// <param name="gptClient"></param>
21
26
public CommandManager (
27
+ ISlackApiClient slackApiClient ,
28
+ GptClient gptClient ,
29
+ SlackSettings slackSettings ,
22
30
GptCustomCommands customCommands ,
23
31
SlackBotInfo botInfo ,
24
32
IUserCommandDb userCommandDb ,
25
33
GptDefaults gptDefaults ,
26
34
ILogger log )
27
35
{
28
36
var parameterManager = new ParameterManager ( customCommands , gptDefaults , userCommandDb ) ;
37
+ var messageHandler = new SlackMessageEventBaseHandler ( slackApiClient , log , gptClient , botInfo ,
38
+ slackSettings ) ;
29
39
40
+ AddCommandStrategy ( new GenerateCommandStrategy ( messageHandler ) ) ;
30
41
AddCommandStrategy ( new HelpCommandStrategy ( gptDefaults , botInfo , customCommands , userCommandDb ,
31
42
parameterManager ) ) ;
32
43
AddCommandStrategy ( new StatusCommandStrategy ( ) ) ;
@@ -42,7 +53,7 @@ public Task<SlashCommandResponse> Execute(SlashCommand command)
42
53
if ( strategy . CanHandle ( command ) ) return strategy . Execute ( command ) ;
43
54
}
44
55
45
- return Task . FromResult ( CommandStrategyUtils . SlashCommandResponse ( "Command not found." ) ) ;
56
+ return Task . FromResult ( CommandStrategyUtils . SlashCommandResponse ( "Command not found. Type /gpt help or /gpt generate [prompt] to get started. " ) ) ;
46
57
}
47
58
48
59
private void AddCommandStrategy ( ICommandStrategy commandStrategy )
0 commit comments