All Projects → biezhi → Wechat Api

biezhi / Wechat Api

Licence: mit
🗯 wechat-api by java7.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Wechat Api

Werobot
WeRoBot 是一个微信公众号开发框架
Stars: ✭ 3,973 (+119.14%)
Mutual labels:  wechat-sdk, wechat, wechat-framework
Weixinmpsdk
微信全平台 SDK Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 6.0。已支持微信公众号、小程序、小游戏、企业号、企业微信、开放平台、微信支付、JSSDK、微信周边等全平台。 WeChat SDK for C#.
Stars: ✭ 7,098 (+291.51%)
Mutual labels:  wechat-sdk, wechat
Weixin Java Miniapp Demo
基于Spring Boot 和 WxJava 实现的微信小程序Java后端Demo
Stars: ✭ 779 (-57.03%)
Mutual labels:  wechat-sdk, wechat
Yii2 Wx
这可能是yii2中最好用的微信SDK🔥🔥🔥
Stars: ✭ 148 (-91.84%)
Mutual labels:  wechat-sdk, wechat
Wechat Php Sdk
PHP微信SDK(微信平台 + 微信支付)
Stars: ✭ 637 (-64.86%)
Mutual labels:  wechat-sdk, wechat
Diplomat
整合第三方 SDK 微信、微博、 QQ 等为统一的 Diplomat 接口。
Stars: ✭ 672 (-62.93%)
Mutual labels:  wechat-sdk, wechat
Gochat
🔥 微信 Go SDK 🚀🚀🚀
Stars: ✭ 141 (-92.22%)
Mutual labels:  wechat-sdk, wechat
React Native Wechat
🚀 WeChat login, share, favorite and payment for React-Native on iOS and Android platforms (QQ: 336021910)
Stars: ✭ 2,842 (+56.76%)
Mutual labels:  wechat-sdk, wechat
Gopay
QQ、微信(WeChat)、支付宝(AliPay)的Go版本SDK。【微信支付V3已支持,推荐使用微信V3接口】
Stars: ✭ 1,034 (-42.97%)
Mutual labels:  wechat-sdk, wechat
Wechat
Wechat API wrapper in Elixir
Stars: ✭ 70 (-96.14%)
Mutual labels:  wechat-sdk, wechat
Cordova Plugin Wechat
A cordova plugin, a JS version of Wechat SDK
Stars: ✭ 1,198 (-33.92%)
Mutual labels:  wechat-sdk, wechat
Wechatcmd
提供微信终端版本、微信命令行版本聊天功能、微信机器人
Stars: ✭ 628 (-65.36%)
Mutual labels:  wechat-sdk, wechat
Easyopenwechat
微信公众号第三方平台SDK
Stars: ✭ 105 (-94.21%)
Mutual labels:  wechat-sdk, wechat
Python Weixin
微信(weixin|wechat) Python SDK 支持开放平台和公众平台 支持微信小程序云开发
Stars: ✭ 746 (-58.85%)
Mutual labels:  wechat-sdk, wechat
Wepay
轻量的微信支付组件(A Lightweight Wechat Pay Component)
Stars: ✭ 343 (-81.08%)
Mutual labels:  wechat-sdk, wechat
Entwechat
📦 WeChat Enterprise SDK based on EasyWeChat 3.X
Stars: ✭ 12 (-99.34%)
Mutual labels:  wechat-sdk, wechat
wechat-api-examples
wechat-api examples, used java8.
Stars: ✭ 12 (-99.34%)
Mutual labels:  wechat-bot, wechat-api
Wechatpy
WeChat SDK for Python
Stars: ✭ 3,016 (+66.35%)
Mutual labels:  wechat-sdk, wechat
Tom Vpr
how does voiceprint recognition work in wechat page
Stars: ✭ 37 (-97.96%)
Mutual labels:  wechat-sdk, wechat
Wechat
API, command and message handling for WeChat in Rails
Stars: ✭ 1,251 (-31%)
Mutual labels:  wechat-sdk, wechat

wechat-api

wechat-api 是微信个人号的Java版本API,让个人号具备更多能力,提供方便的接口调用。

在线文档

@biezhi on zhihu

特性

  • 使用简单,引入依赖即可
  • 支持本地图片和终端输出二维码
  • 本地自动登录
  • 支持文本、图片、视频、撤回消息等
  • 支持发送文本、图片、附件
  • 注解绑定消息监听
  • 群聊、单聊支持
  • 添加好友验证
  • 撤回消息获取
  • JDK7+

使用

本地开发的同学请先安装 lombok 插件并确保你的JDK环境是1.7+

引入 maven 依赖

<dependency>
    <groupId>io.github.biezhi</groupId>
    <artifactId>wechat-api</artifactId>
    <version>1.0.6</version>
</dependency>

构建自己的小机器人

public class HelloBot extends WeChatBot {
    
    public HelloBot(Config config) {
        super(config);
    }
    
    @Bind(msgType = MsgType.TEXT)
    public void handleText(WeChatMessage message) {
        if (StringUtils.isNotEmpty(message.getName())) {
            log.info("接收到 [{}] 的消息: {}", message.getName(), message.getText());
            this.sendMsg(message.getFromUserName(), "自动回复: " + message.getText());
        }
    }
    
    public static void main(String[] args) {
        new HelloBot(Config.me().autoLogin(true).showTerminal(true)).start();
    }
    
}

Bot API

/**
 * 给文件助手发送消息
 *
 * @param msg 消息内容
 * @return 发送是否成功
 */
boolean sendMsgToFileHelper(String msg);

/**
 * 给某个用户发送消息
 *
 * @param name 用户UserName
 * @param msg  消息内容
 * @return 发送是否成功
 */
boolean sendMsg(String name, String msg);

/**
 * 根据名称发送消息
 *
 * @param name 备注或昵称,精确匹配
 * @param msg  消息内容
 * @return 发送是否成功
 */
boolean sendMsgByName(String name, String msg);

/**
 * 给某个用户发送图片消息
 *
 * @param name    用户UserName
 * @param imgPath 图片路径
 * @return 发送是否成功
 */
boolean sendImg(String name, String imgPath);

/**
 * 根据名称发送图片消息
 *
 * @param name    备注或昵称,精确匹配
 * @param imgPath 图片路径
 * @return 发送是否成功
 */
boolean sendImgName(String name, String imgPath);

/**
 * 给用户发送文件
 *
 * @param name     用户UserName
 * @param filePath 文件路径
 * @return 发送是否成功
 */
boolean sendFile(String name, String filePath);

/**
 * 根据名称发送文件消息
 *
 * @param name     备注或昵称,精确匹配
 * @param filePath 文件路径
 * @return 发送是否成功
 */
boolean sendFileName(String name, String filePath);

更多API见文档

TODO

  1. 接收位置
  2. 撤回消息查看
  3. 发送文件消息
  4. 多线程处理消息

开源协议

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].