Created
July 17, 2018 14:32
-
-
Save mike-neck/189997dd3f90d4a6843ce533cbba8736 to your computer and use it in GitHub Desktop.
daab-kt の動かせる構造など
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example | |
import com.lisb.daab.ActionResponse | |
import com.lisb.daab.Response | |
import com.lisb.daab.Robot | |
import com.lisb.daab.TextMessage | |
import com.lisb.daab.message.QuestionAfterMessageHandler | |
import com.lisb.daab.message.QuestionSent | |
import com.lisb.daab.message.Stamp | |
import com.lisb.daab.receive.Receive | |
import kotlin.js.RegExp | |
val application: (Robot) -> Unit = {robot: Robot -> | |
robot.hear(RegExp("PING", "i"), sendPong) | |
robot.respond(Receive.Stamp) { res: ActionResponse<Stamp> -> | |
println(res.json) | |
} | |
} | |
val sendPong: (Response<TextMessage>) -> Unit = { res: Response<TextMessage> -> | |
println(res.message.text) | |
res.send("pong") | |
res.send(QuestionAfterMessageHandler(question = "もふもふ", onSend = { sent: QuestionSent -> | |
println(sent) | |
println(sent) | |
})) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
mavenLocal() | |
} | |
dependencies { | |
classpath "com.lisb.daab:gradle-daab-plugin:${daabPluginVersion}" | |
} | |
} | |
apply plugin: 'daab-kt' | |
repositories { | |
mavenLocal() | |
} | |
dependencies { | |
compile "com.lisb.daab:daab-kt:${daabPluginVersion}" | |
} | |
daab { | |
mainPackage 'com.example' | |
appName 'application' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "starter", | |
"version": "0.3.6", | |
"private": true, | |
"author": "L is B corp.", | |
"keywords": [ | |
"hubot", | |
"direct", | |
"bot", | |
"daab" | |
], | |
"description": "A simple helpful robot for your Company", | |
"dependencies": { | |
"kotlin": "^1.1.3-2", | |
"lisb-hubot": "^2.16.0", | |
"lisb-hubot-redis-brain": "^0.0.3", | |
"lisb-forever": "^0.15.3" | |
}, | |
"engines": { | |
"node": ">= 0.8.x", | |
"npm": ">= 1.1.x" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local-dev/ | |
├── build.gradle | |
├── daab | |
│ ├── Berksfile | |
│ ├── Dockerfile | |
│ ├── LICENSE | |
│ ├── Procfile | |
│ ├── README.md | |
│ ├── Vagrantfile | |
│ ├── external-scripts.json | |
│ ├── hubot-err.log | |
│ ├── hubot.log | |
│ ├── package-lock.json | |
│ ├── package.json | |
│ └── scripts | |
│ ├── app.js | |
│ └── lib | |
│ ├── application | |
│ │ └── com | |
│ │ └── example | |
│ │ └── example.kjsm | |
│ ├── application.js | |
│ ├── application.js.map | |
│ ├── application.meta.js | |
│ └── daab-kt-js-binding.js | |
├── echo-path.sh | |
└── src | |
└── main | |
└── kotlin | |
└── com | |
└── example | |
└── App.kt | |
処理が今の所見当たらない
daab-kt.js
が見つからないらしい
Configuration.kt の 78 行目
.also { it.executable = daab.executable }
が間違えてるので、修正する
daab-kt-js-bindings.js
の読み込みを require('./daab-kt-js-bindings')
としないと読み込めないっぽい
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
多分
daab-kt-js-binding.js
を書き込む処理を書かないと動かないと思われる