• Stars
    star
    388
  • Rank 107,750 (Top 3 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Java Wechaty is a Conversational SDK for Chatbot Makers Written in Kotlin

java-wechaty

Java CI with Maven Java Version

Java Wechaty

Java Wechaty Getting Started Wechaty in Kotlin

Connecting Chatbots

Powered by Wechaty Kotlin

Wechaty is a RPA SDK for Wechat Individual Account that can help you create a chatbot in 6 lines of Java.

Voice of the Developers

"Wechaty is a great solution, I believe there would be much more users recognize it." link
— @Gcaufy, Tencent Engineer, Author of WePY

"太好用,好用的想哭"
— @xinbenlv, Google Engineer, Founder of HaoShiYou.org

"最好的微信开发库" link
— @Jarvis, Baidu Engineer

"Wechaty让运营人员更多的时间思考如何进行活动策划、留存用户,商业变现" link
— @lijiarui, Founder & CEO of Juzi.BOT.

"If you know js ... try Wechaty, it's easy to use."
— @Urinx Uri Lee, Author of WeixinBot(Python)

See more at Wiki:Voice Of Developer

Join Us

Wechaty is used in many ChatBot projects by thousands of developers. If you want to talk with other developers, just scan the following QR Code in WeChat with secret code java wechaty, join our Wechaty Java Developers' Home.

Wechaty Friday.BOT QR Code

Scan now, because other Wechaty Java developers want to talk with you too! (secret code: java wechaty)

The World's Shortest Java ChatBot: 6 lines of Code

class Bot{
  public static void main(String args[]){
    Wechaty bot = Wechaty.instance()
      .onScan((qrcode, statusScanStatus, data) -> System.out.println(QrcodeUtils.getQr(qrcode)))
      .onLogin(user -> System.out.println("User logined :" + user))
      .onMessage(message -> System.out.println("Message:" + message))
      .start(true);
  }
}

if use plugins

class Bot{
  public static void main(String args[]){
    Wechaty bot = Wechaty.instance()
            .use(
                WechatyPlugins.ScanPlugin(), 
                WechatyPlugins.DingDongPlugin(null))
            .start(true);
  }
}

Development

To be writen:

make install
make bot

Java Wechaty Developing Plan

We already have Wechaty in TypeScript, It will be not too hard to translate the TypeScript(TS) to Java because wechaty has only 3,000 lines of the TS code, they are well designed and de-coupled by the wechaty-puppet abstraction. So after we have translated those 3,000 lines of TypeScript code, we will almost be done.

As we have already a ecosystem of Wechaty in TypeScript, so we will not have to implement everything in Java, especially, in the Feb 2020, we have finished the @chatie/grpc service abstracting module with the wechaty-puppet-hostie implmentation.

The following diagram shows out that we can reuse almost everything in TypeScript, and what we need to do is only the block located at the top right of the diagram: Wechaty (Java).

  +--------------------------+ +--------------------------+
  |                          | |                          |
  |   Wechaty (TypeScript)   | |     Wechaty (Java)       |
  |                          | |                          |
  +--------------------------+ +--------------------------+

  +-------------------------------------------------------+
  |                 Wechaty Puppet Hostie                 |
  |                                                       |
  |                (wechaty-puppet-hostie)                |
  +-------------------------------------------------------+

+---------------------  @chatie/grpc  ----------------------+

  +-------------------------------------------------------+
  |                Wechaty Puppet Abstract                |
  |                                                       |
  |                   (wechaty-puppet)                    |
  +-------------------------------------------------------+

  +--------------------------+ +--------------------------+
  |      Pad Protocol        | |      Web Protocol        |
  |                          | |                          |
  | wechaty-puppet-padplus   | |(wechaty-puppet-puppeteer)|
  +--------------------------+ +--------------------------+
  +--------------------------+ +--------------------------+
  |    Windows Protocol      | |       Mac Protocol       |
  |                          | |                          |
  | (wechaty-puppet-windows) | | (wechaty-puppet-macpro)  |
  +--------------------------+ +--------------------------+

Example: How to Translate TypeScript to Java

There's a 100 lines class named Image in charge of downloading the WeChat image to different sizes.

It is a great example for demonstrating how do we translate the TypeScript to Java in Wechaty Way:

Image Class Source Code

If you are interested in the translation and want to look at how it works, it will be a good start from reading and comparing those two Image class files in TypeScript and Java at the same time.

To-do List

  • TS: TypeScript
  • SLOC: Source Lines Of Code

Wechaty Internal Modules

  1. Class Wechaty
  2. Class Contact
  3. Class ContactSelf
  4. Class Message
  5. Class Room
  6. Class Image
  7. Class Accessory
  8. Class Config
  9. Class Favorite
  10. Class Friendship
  11. Class MiniProgram
  12. Class RoomInvitation
  13. Class Tag
  14. Class UrlLink

Wechaty External Modules

  1. Class FileBox
  2. Class MemoryCard
  3. Class WechatyPuppet
  4. Class WechatyPuppetHostie

Usage

  1. Add a token to class io.github.wechaty.example.Main in folder examples/src/main/java

  2. Build:

    cd examples/  
    mvn install
  3. Run

    java -jar target/wechaty-example-1.0.0-SNAPSHOT-jar-with-dependencies.jar
    # or run in background  
    nohup java -jar target/wechaty-example-1.0.0-SNAPSHOT-jar-with-dependencies.jar &>> nohup.out & tailf nohup.out
  4. enjoy

Requirements

  1. JDK/JRE

Install

mvn install wechaty

Links

  1. Publish Java Module to Maven Central Repo - OSSRH Guide
  2. Kotlin vs Java: Most Important Differences That You Must Know

History

master

v0.4 (Jun 19, 2020)

Java(Kotlin) Wechaty BETA Released!

Read more from our Multi-language Wechaty Beta Release event from our blog:

v0.1.4 (June 13 2020)

  1. use PuppetManager to manage multi puppet implementations.
  2. add mock puppet.
  3. remove puppet implementations from wechaty pom. Which implementation to use depends on which implementation jar in your pom.
  4. fix some bugs.

v0.1.3 (June 6 2020)

  1. support plugins!

v0.1.2 (June 6 2020)

  1. change method on(Event:String,Listener:listener) to onEvent(Listener:listener). See examples
  2. update version to 0.1.2
  3. update wechaty grpc to 0.16.1
  4. move examples from wechaty to independent module. Make example easy to use.

v0.1.1 (May 31 2020)

  1. update version to 0.1.1-SNAPSHOT
  2. finish all function of room
  3. remove log4j2 package from wechaty
  4. change all log level to debug
  5. remove log4j2.xml from wechaty

v0.1 (May 18 2020)

We decided to use Kotlin to develop the Java Wechaty!

  1. Project re-inited by overwriting wechaty/java-wechaty by diaozxin/kotlin-wechaty.
  2. Second contributor joined: @redmaple1 Xiaoya Ren

v0.0.1 (Mar 12, 2020)

  1. Project created.
  2. First contributor joined: @diaozxin007 Zhengxin DIAO (刁政欣)

Related Projects

  • Wechaty - Conversatioanl AI Chatot SDK for Wechaty Individual Accounts (TypeScript)
  • Python Wechaty - Python WeChaty Conversational AI Chatbot SDK for Wechat Individual Accounts (Python)
  • Go Wechaty - Go WeChaty Conversational AI Chatbot SDK for Wechat Individual Accounts (Go)
  • Java Wechaty - Java WeChaty Conversational AI Chatbot SDK for Wechat Individual Accounts (Java)
  • Scala Wechaty - Scala WeChaty Conversational AI Chatbot SDK for WechatyIndividual Accounts (Scala)

Stargazers over time

Stargazers over time

Badge

Wechaty in Kotlin

[![Wechaty in Kotlin](https://img.shields.io/badge/Wechaty-Kotlin-orange)](https://github.com/wechaty/java-wechaty)

Contributors

contributors contributors contributors contributors contributors contributors contributors contributors

Committers

Creator

Copyright & License

  • Code & Docs © 2020 Wechaty Contributors https://github.com/wechaty
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons

More Repositories

1

wechaty

Conversational RPA SDK for Chatbot Makers. Join our Discord: https://discord.gg/7q8NBZbQzt
TypeScript
19,147
star
2

python-wechaty

Python Wechaty is a Conversational RPA SDK for Chatbot Makers written in Python
Python
1,519
star
3

getting-started

A Starter Project Template for Wechaty works out-of-the-box
JavaScript
760
star
4

puppet-padlocal

Puppet PadLocal is a Pad Protocol for WeChat
TypeScript
576
star
5

go-wechaty

Go Wechaty is a Conversational SDK for Chatbot Makers Written in Go
Go
461
star
6

puppet-xp

Wechaty Puppet WeChat Windows Protocol
JavaScript
419
star
7

puppet-wechat

Wechaty Puppet Provider for WeChat
TypeScript
391
star
8

wechaty-puppet-padplus

DEPRECATED: One puppet based on iPad protocal for Wechaty
TypeScript
311
star
9

wechaty-puppet-padchat

Padchat Puppet for Wechaty
TypeScript
278
star
10

wechaty-puppet-padpro

TypeScript
235
star
11

puppet

Puppet Provider Abstraction for Wechaty
TypeScript
221
star
12

python-wechaty-getting-started

Python Wechaty Starter Project Template that Works Out-of-the-Box
Makefile
173
star
13

matrix-appservice

Wechaty [Matrix] Application Services Bridge
TypeScript
131
star
14

docusaurus

Wechaty Official Website for Documentations, Powered by Docusaurus.
MDX
112
star
15

puppet-wechat4u

Wechat4u Puppet for Wechaty
TypeScript
85
star
16

friday

Friday is an Assistant BOT Built on Wechaty for Serving our Community
TypeScript
81
star
17

dotnet-wechaty

.NET Wechaty is a Conversational SDK for Chatbot Makers Written in C#
C#
77
star
18

puppet-service

Wechaty Puppet Provider for providing/consuming the Wechaty Puppet Service
TypeScript
64
star
19

docker-getting-started

Getting Started Template for Docker Users
TypeScript
62
star
20

python-wechaty-template

getting started project template for python-wechaty
Python
53
star
21

php-wechaty

PHP Wechaty is a Conversational SDK for Chatbot Makers Written in PHP https://github.com/wechaty/docker-php-wechaty-getting-started
PHP
53
star
22

java-wechaty-getting-started

Java Wechaty Starter Project Template that Works Out-of-the-Box
Makefile
44
star
23

puppet-mock

Puppet Mocker for Wechaty (& A Puppet Template Starter)
TypeScript
44
star
24

go-wechaty-getting-started

Go Wechaty starter project template that works out-of-the-box
Makefile
42
star
25

bot5

Bot Friday Club - BOT5
TypeScript
39
star
26

python-wechaty-puppet-itchat

Python Wechaty Puppet Powered by Itchat
Python
38
star
27

jekyll

Wechaty Official Website for News, Blogs, Contributor Profiles, Powered by Jekyll.
Java
37
star
28

plugin-contrib

Wechaty Plugin Ecosystem Contrib Package
TypeScript
32
star
29

summer

Summer of Wechaty (SoW) is a program for connecting students with the Wechaty community for coding & tech writing.
31
star
30

puppet-supports

Wechaty Puppet Services (WPS)
27
star
31

chatbot-0-to-1

Chatbot Zero to One
TypeScript
26
star
32

rust-wechaty

Rust Wechaty is a Conversational RPA SDK for Chatbot Makers written in Rust
Rust
23
star
33

puppet-whatsapp

Wechaty Puppet for Whatsapp
TypeScript
23
star
34

openapi

Wechaty REST API Server with OpenAPI Specification (aka. Swagger)
JavaScript
23
star
35

webwx-app-tracker

Live Tracking webwxApp Version Change
JavaScript
22
star
36

puppet-lark

Wechaty Puppet for Lark
TypeScript
20
star
37

wechaty-electron

Wechaty for Desktop
JavaScript
18
star
38

java-wechaty-bak

Java Wechaty is an RPA SDK for WeChat Individual Account
Java
15
star
39

botbuilder-wechaty-adapter

Microsoft Bot Framework v4 Adapter for Wechat Individual Account
TypeScript
15
star
40

puppet-oicq

Wechaty Puppet for QQ based on project takayama-lily/oicq-template
TypeScript
14
star
41

wechaty-weixin-openai

Wechaty plugin for integrate your bot with weixin openai-sdk
TypeScript
13
star
42

puppet-official-account

Wechaty Puppet for WeChat Official Account
TypeScript
13
star
43

python-wechaty-plugin-contrib

Wechaty Plugin Ecosystem Contrib Package
Python
13
star
44

python-wechaty-puppet

Python Puppet Provider Abstraction for Wechaty
Python
12
star
45

dotnet-wechaty-getting-started

.NET Wechaty Starter Project Template that Works Out-of-the-Box
C#
11
star
46

heroku-wechaty-getting-started

Wechaty Starter Project Template with Heroku Deploy Button that Works Out-of-the-Box
TypeScript
9
star
47

mac-wechat-app-tracker

macOS WeChat.app header files version history (automatic updated)
Objective-C
9
star
48

php-wechaty-getting-started

PHP Wechaty Starter Project Template that Works Out-of-the-Box
Makefile
8
star
49

scala-wechaty

Scala Wechaty is a Conversational SDK for Chatbot Makers Written in Scala
Scala
8
star
50

python-wechaty-puppet-padplus

Python Hostie Puppet for Wechaty
Python
7
star
51

python-wechaty-puppet-service

Python Puppet Service Client for Wechaty
Python
7
star
52

wechaty-puppet-dingtalk

TypeScript
7
star
53

puppet-walnut

Wechaty Puppet Walnut - 硬核桃5G消息
TypeScript
7
star
54

easy-matrix-wechaty

A simple and fast temporary deployment solution for [matrix-appservice-wechaty](https://github.com/wechaty/matrix-appservice-wechat) with matrix. (Easy to be a multi bridge server for other matrix bridges.)
Shell
7
star
55

wishlist

Puppets, Bots, and other Tooling Requested by Community Members
6
star
56

chat

Friday BOT empowered by GPT-4 with maximum token length 32K, grounded with Wechaty SDK knowledge
5
star
57

wechaty-ui

Web UI for polyglot-wechaty based on the plugin system.
Vue
5
star
58

im-aggregation

Aggregate WeCom, WeChat, and WhatsApp together.
TypeScript
5
star
59

cqrs

An event-driven architecture wrapper for Wechaty that applies the CQS principle by using separate Query and Command messages to retrieve and modify the bot state, respectively.
TypeScript
5
star
60

vorpal-contrib

Wechaty Vorpal Chat CLI (Command Line Interface) Commands
TypeScript
4
star
61

wechaty-puppet-macOS

Wechaty Puppet Provider: macOS,make your macOS as a service provider for your self.
Objective-C
4
star
62

PMC

Project Management Committees
Shell
4
star
63

plugin-qnamaker

QnAMaker.ai Plugin for Wechaty
TypeScript
4
star
64

ha

High Available (HA) Wechaty is a Load Balance for providing High Availability for Wechaty Chatbot by spreading requests across multiple WeChat individual accounts.
TypeScript
4
star
65

redux

Wechaty Redux Plugin, Reducer Bundle, and Ducks Proposal Implementation.
TypeScript
4
star
66

wechaty-got-kicked-out

this is a wechaty plugin to monitor whether your bot is kicked out of group chat.
TypeScript
4
star
67

plugin-chatopera

🐸 Chatopera Plugin for Wechaty
TypeScript
3
star
68

sidecar-demos

Sidecar Demos & Examples
JavaScript
3
star
69

cli

Terminal Client for Wechaty
TypeScript
3
star
70

bot5-rasa-nlu

Rasa NLU for Bot5
Dockerfile
3
star
71

vorpal

CLI for Chatbot - Extensible Commands for ChatOps, Powered by Vorpal.
TypeScript
3
star
72

docker-php-wechaty-getting-started

Getting Started Template for Docker Users
Shell
2
star
73

puppet-discord

Discord Puppet for Wechaty
TypeScript
2
star
74

bot5-assistant

BOT Friday Club Meeting Assistant BOT
TypeScript
2
star
75

ducks-contrib

Wechaty Ducks Contrib
JavaScript
2
star
76

token

Wechaty Token-Based Authentication Manager
TypeScript
2
star
77

ngNext-hackthon-2020-Conversational-AI

2
star
78

plugin-freshdesk

Wechaty Freshdesk Plugin helps Freshdesk unifies conversations from WeChat, and helps you resolve issues across channels effortlessly!
TypeScript
2
star
79

chat-drive

Chat Drive is a conversational storage solution that allows you to save files from the WeChat room, and search & access them anytime by talking to our chatbot.
TypeScript
2
star
80

chatbot-1-to-2

the source code of chatbot-1-to-2
JavaScript
1
star
81

qrcode

Online QRCode Image Generator
HTML
1
star
82

php-grpc

PHP Stubs for Chatie GRPC (DO NOT EDIT: Code generated by grpc_php_plugin)
PHP
1
star
83

js.org

Wechaty Official Website for News, Blogs, Contributor Profiles, and Documentations.
1
star
84

rust-wechaty-getting-started

Rust Wechaty Starter Project Template that Works Out-of-the-Box
Makefile
1
star
85

OSSRH-56843

https://issues.sonatype.org/browse/OSSRH-56843
1
star
86

go-grpc

Go Stubs for Chatie GRPC (DO NOT EDIT: Code generated by protoc-gen-go)
1
star
87

python-wechaty-puppet-official-account

Wechaty Puppet for WeChat Official Account
Python
1
star
88

OSSRH-56865

https://issues.sonatype.org/browse/OSSRH-56865
1
star
89

puppet-gitter

Gitter.im Puppet for Wechaty
TypeScript
1
star
90

actor

Wechaty Actor Model, Powered by XState, Mailbox, and CQRS
JavaScript
1
star
91

plugin-intercom

Wechaty Intercom Plugin helps you build better customer relationships through WeChat across the customer journey.
TypeScript
1
star
92

wechaty-puppet-sidecar

A Universal Puppet Powered by Sidecar
TypeScript
1
star