Facebook messenger group chat bot. Expands upon the MessengerBotAPI system.
While this class is not instantiable it provides a base class to extend.
class ChatbotTest extends Chatbot {
public ChatbotTest(Config config) throws SQLException {
super(config);
}
public static void main(String[] args) throws SQLException {
String configFile = args.length > 0 ? args[0] : null;
new ChatbotTest(new Config(configFile));
}
@Override
protected void loadModules(Connection connection) throws SQLException {
modules.put("Google", new OneLinkCommand(this,
Arrays.asList("google"),
"Google",
"https://www.google.com"
));
}
}
You can make your own custom modules using the CommandModule
and DatabaseModule
interfaces. CommandModule
is called every time a new message arrives and its method process(Message message)
is called. If the program required Database access then it must implement the DatabaseModule and its method prepareStatements(Connection connection)
.