Skip to content

A chatbot that can parse natural-language commands and communicate via SMS.

License

Notifications You must be signed in to change notification settings

keotl/smsChatbot

Repository files navigation

Command definition

@CommandListener
public class SayHelloCommand {

    @CommandHandler(command = "say hello <int> time")
    public void execute(int times) {
        for (int i = 0; i < times; i++) {
            System.out.println("Hello");
        }
    }

    @CommandHandler(command = "say <str> hello <int>")
    public void namedHello(String name, int times) {
        for (int i = 0; i < times; i++) {
            System.out.println("Hello " + name + "!");
        }
    }

    @CommandHandler(command = "drop table <str>", requiredRole = UserRoleEnum.ADMIN)
    public void dropTable(String name) {
        System.out.println("WARNING: Dropping table !");
    }

    //This command can only be executed after the "execute" method has been called.
    @Conversational("execute")
    @CommandHandler(command = "one more time") {
        System.out.println("Hello");
    }
}

About

A chatbot that can parse natural-language commands and communicate via SMS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published