AutoResponder Integration
About The Project
An unofficial java integration for the AutoResponder App. Use it to create a more professional and complex bot
Setup guide
If you want to set this up in the AutoResponder app, you need to follow our setup guide
Installation
- Add the jitpack repository to your
pom.xml
<repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories>
- Add the dependency to your
pom.xml
<dependency> <groupId>com.github.gnmyt</groupId> <artifactId>AutoResponder-Integration</artifactId> <version>1.0.0</version> </dependency>
Usage Examples
1. Creating a new auto responder instance
SimpleAutoResponder autoResponder = new SimpleAutoResponder();
2. Setting up the responder
- If you want to you can set the port of the server
autoResponder.setPort(8025);
- You can also set a prefix of the commands
autoResponder.setPrefix("!");
- You want to secure the webserver? No problem. Just set an authentication and don't forget to set it in the responder
app!
autoResponder.useAuthentication("username", "password");
- Now lets start the integration
autoResponder.start();
3. Custom Handlers
- Using the random error handler. It sends random messages from a list if the message could not be found
autoResponder.useNotFoundHandler(new RandomErrorHandler("Error message 1", "Error message 2", "Error message 3"));
- (Default) Doing nothing. Just ignoring the not found messages. It sends a random replies array back to the responder
autoResponder.useNotFoundHandler(new SendNothingHandler());
- Using the simple error handler. It sends all messages from a list if the messages could not be found.
autoResponder.useNotFoundHandler(new SendErrorHandler("First message", "Second message", "Third message"));
You can find a full example of that in the CustomHandlersExample
4. Dialogflow Integration
Do you want to integrate Dialogflow into your project? No problem. If you want to only let dialogflow handle the message if it could not be found, take a look at the step above. You like to do it your own? No problem. Just create a new DialogflowIntegration class.
DialogflowIntegration integration=new DialogflowIntegration(new File("your_credentials_file.json"));
integration.setLanguageCode("de"); // Here you can set the language of the integration
integration.getMessage("My message","The sender of the message / a session id for better training");
5. Listeners
This project supports listeners. That means you can create your own, custom events that happen after the responder sent
us something. You can use the ChatMessageReceivedEvent
or the GroupMessageReceivedEvent
for that. If you want to
learn more, check out the ListenerExample
6. Commands
This project also supports commands. That means that you create your own custom commands that happen after the responder
sent us the command. You can use the ResponderGroupCommand
or the ResponderChatCommand
to handle those commands. If
you want to learn more, check out the CommandExample
7. Secondary use
You use the AutoResponder app as main place of your rules, any you only want to react to all commands? No problem. Just create a new rule and set your command prefix before the "*". The responder will thn only react if the message is a command
Other examples
You can find some other examples in the examples directory.
License
Distributed under the Apache-2.0 License. See LICENSE
for more information.
End
Currently, there are not many features, so feel free to write me some suggestions!