66import simplexity .commands .CommandManager ;
77import simplexity .commands .ExitCommand ;
88import simplexity .commands .HelpCommand ;
9+ import simplexity .commands .ReloadCommand ;
910import simplexity .config .TTSConfig ;
1011import simplexity .messages .Errors ;
12+ import simplexity .twitch .TwitchClientHandler ;
1113
1214import java .util .Scanner ;
1315
1416public class Main {
1517 private static CommandManager commandManager ;
1618 private static PollyHandler pollyHandler ;
1719 private static SpeechHandler speechHandler ;
20+ private static TwitchClientHandler twitchClientHandler ;
1821
1922 public static void main (String [] args ) {
2023 Scanner scanner = new Scanner (System .in );
@@ -23,31 +26,34 @@ public static void main(String[] args) {
2326 TTSConfig .getInstance ().reloadConfig ();
2427 pollyHandler = createPollyHandler ();
2528 speechHandler = new SpeechHandler ();
29+ twitchClientHandler = new TwitchClientHandler ();
30+ twitchClientHandler .setupClient ();
31+ twitchClientHandler .getTwitchClient ().getChat ().joinChannel ("RhythmWeHear" );
32+ System .out .println (twitchClientHandler .getTwitchClient ().getChat ().sendMessage ("RhythmWeHear" , "Test" ));
2633 while (true ) {
2734 String input = scanner .nextLine ();
28- if (input .equals ("exit" )) {
35+ if (input .equals ("-- exit" )) {
2936 break ;
3037 }
3138 if (!commandManager .runCommand (input )) {
32- System .out .println ("that is not a command" );
3339 speechHandler .processSpeech (input );
3440 } else {
3541 System .out .println ("command executed" );
36-
3742 }
3843 }
3944 }
4045
41- private static void registerCommands (CommandManager commandManager ){
46+ private static void registerCommands (CommandManager commandManager ) {
4247 commandManager .registerCommand (new HelpCommand ("--help" , "Displays the help messages" ));
4348 commandManager .registerCommand (new ExitCommand ("--exit" , "Terminates the program" ));
49+ commandManager .registerCommand (new ReloadCommand ("--reload" , "Reloads the configuration" ));
4450 }
4551
4652 public static CommandManager getCommandManager () {
4753 return commandManager ;
4854 }
4955
50- public static PollyHandler createPollyHandler (){
56+ public static PollyHandler createPollyHandler () {
5157 PollyHandler pollyHandler = null ;
5258 String awsAccessID = TTSConfig .getInstance ().getAwsAccessID ();
5359 String awsSecretKey = TTSConfig .getInstance ().getAwsSecretKey ();
@@ -65,6 +71,8 @@ public static PollyHandler createPollyHandler(){
6571 return pollyHandler ;
6672 }
6773
74+
75+
6876 public static PollyHandler getPollyHandler () {
6977 return pollyHandler ;
7078 }
0 commit comments