https://github.com/wechaty/scala-wechaty-getting-started
Scalar Wechaty Starter Project Template that Works Out-of-the-Box
https://github.com/wechaty/scala-wechaty-getting-started
getting-started scala wechaty
Last synced: about 1 year ago
JSON representation
Scalar Wechaty Starter Project Template that Works Out-of-the-Box
- Host: GitHub
- URL: https://github.com/wechaty/scala-wechaty-getting-started
- Owner: wechaty
- License: apache-2.0
- Created: 2020-06-02T15:39:17.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-31T17:27:29.000Z (almost 5 years ago)
- Last Synced: 2025-06-06T10:11:36.668Z (about 1 year ago)
- Topics: getting-started, scala, wechaty
- Language: Makefile
- Homepage: https://gitpod.io/#https://github.com/wechaty/scala-wechaty-getting-started
- Size: 90.8 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scala-wechaty-getting-started

[](https://gitpod.io/#https://github.com/wechaty/scala-wechaty-getting-started)
[](https://github.com/wechaty/scala-wechaty)
Scala Wechaty Starter Project Template that Works Out-of-the-Box
## Connecting Chatbots
[](https://github.com/Wechaty/wechaty)
Wechaty is a RPA SDK for Wechat **Individual** Account that can help you create a chatbot in 6 lines of Scala.
## Requirements
1. Scala
## Quick Start
1. Clone scala-wechaty-getting-started repository
```shell
git clone https://github.com/wechaty/scala-wechaty-getting-started
cd scala-wechaty-getting-started
```
2. Install Dependencies
```shell
make install
```
3. Set token for your bot
```sh
# it must be hostie token
export WECHATY_PUPPET=wechaty-puppet-hostie
export WECHATY_PUPPET_HOSTIE_TOKEN=your_token_at_here
```
4. Run the bot
```shell
make bot
# or
scala examples/ding-dong-bot.scala
```
## The World's Shortest Scala ChatBot: 6 lines of Code
```scala
package wechaty
object DingDongBot {
def main(args: Array[String]): Unit = {
Wechaty.instance()
.onScan(payload => { println("Scan QR Code to login: %s\nhttps://api.qrserver.com/v1/create-qr-code/?data=%s\n".format(payload.status, payload.qrcode)) })
.onLogin(payload => { println("User %s logined\n".format(payload.id)) })
.onMessage(message => { println(message) })
.start()
Thread.currentThread().join()
}
}
```
## Wechaty Getting Started in Multiple Languages
- [TypeScript Wechaty Getting Started](https://github.com/wechaty/wechaty-getting-started)
- [Python Wechaty Getting Started](https://github.com/wechaty/python-wechaty-getting-started)
- [Java Wechaty Getting Started](https://github.com/wechaty/java-wechaty-getting-started)
- [Go Wechaty Getting Started](https://github.com/wechaty/go-wechaty-getting-started)
- [Scala Wechaty Getting Started](https://github.com/wechaty/scala-wechaty-getting-started)
## Badge
[](https://github.com/wechaty/scala-wechaty)
```md
[](https://github.com/wechaty/scala-wechaty)
```
## Maintainers
[@wechaty/scala](https://github.com/orgs/wechaty/teams/scala/members)
## Copyright & License
- Code & Docs © 2020 Wechaty Contributors
- Code released under the Apache-2.0 License
- Docs released under Creative Commons