Skip to content
tiny chat bot framework for Java SE 8.(like a Hubot)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
gradle/wrapper
images
src
.gitignore
LICENSE
README.md
build.gradle
gradle.properties.sample
gradlew
gradlew.bat

README.md

botan(牡丹)

Join the chat at https://gitter.im/masahitojp/botan-core

Circle CI

Maven Central

botan Tiny chat bot framework for Java SE 8.(like a Hubot)

requirement

Java8

Getting Started

Write simple java application

package com.github.masahitojp.implementation;

import com.github.masahitojp.botan.Botan;
import com.github.masahitojp.botan.exception.BotanException;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class SlackBot {

    static public void main(final String[] Args) {

        final Botan botan = new Botan.BotanBuilder()
                .build();
        try {
            botan.start();
        } catch (final BotanException ex) {
            log.warn(ex.getMessage());
        }

    }
}
package com.github.masahitojp.implementation.handlers;

import com.github.masahitojp.botan.Robot;
import com.github.masahitojp.botan.handler.BotanMessageHandlers;

@SuppressWarnings("unused")
public class PingMessageHandlers implements BotanMessageHandlers {

    @Override
    public void register(final Robot robot) {
        robot.respond(
                "ping\z",
                "ping method",
                message -> message.reply("pong")
        );
    }
}

if you want to more examples, see sample project.

Add dependency to your build.gradle

apply plugin: 'java'

repositories.mavenCentral()

dependencies {
	compile 'com.github.masahitojp:botan-core:0.6.+'
}

sourceCompatibility = targetCompatibility = 1.8

Run and View

show your slack team

Features

Currently, supports following adapters and brains:

License

Apache License, Version 2.0

Special Thanks

  • @_pochi -san wrote a nice logo. Thanks!!

Inspired projects

How to write Handlers

  • create class which implements BotanMessageHandlers.
  • Override register method
    • Robot#respond
package com.github.masahitojp.implementation.handlers;

import com.github.masahitojp.botan.Robot;
import com.github.masahitojp.botan.handler.BotanMessageHandlers;

@SuppressWarnings("unused")
public class PingMessageHandlers implements BotanMessageHandlers {

    @Override
    public void register(final Robot robot) {
        robot.respond(
                "ping\z",
                "ping method",
                message -> message.reply("pong")
        );
    }
}
You can’t perform that action at this time.