转载 微信机器人免费方案之wechaty
分类:极客 2021-01-26T22:19:52 33人阅读
github地址:https://github.com/wechaty/wechaty#readme
注意点:
默认使用web 微信处理 但是现在一般禁用了 所以wechat有个替代方案使用ipad 版本,
项目地址 https://github.com/wechaty/wechaty-puppet-padplus。
本项目需要一个token,可以到wechaty官网申请使用
web版本微信简单使用代码:
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);
}
}
相关:ItChat、vbot