{"repo":"SpellingDragon/wechat-robot-go","free":true,"listed":false,"github":"https://github.com/SpellingDragon/wechat-robot-go","clone":"git clone https://github.com/SpellingDragon/wechat-robot-go.git","description":"WeChat iLink Bot API Go SDK - 微信官方机器人启动框架","language":"Go","stars":28,"topics":["api-client","bot","chatbot","go","golang","ilink","messaging","wechat","wechat-api","wechat-bot"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"wechat-robot-go 基于腾讯 iLink Bot API 的微信机器人 Go SDK，几行代码接入微信消息。 English 中文 --- iLink API 参考 ✨ 特性 - 📱 扫码登录 - 自动持久化凭证，一劳永逸 - 🔄 长轮询 - 实时接收消息，自动重连 - 🔑 Context Token - 持久化存储，支持主动推送 - ⌨️ Typing 状态 - 显示\"对方正在输入\" - 📎 富媒体 - 图片/语音/视频/文件，AES-128 加密 - 📝 长文本分割 - 智能分片，自然边界切分 - 🔧 中间件 - 可组合的日志、限流、认证链 - 🛡️ 容错设计 - Panic 恢复，优雅关闭 - 📦 零依赖 - 仅使用 Go 标准库 --- 🚀 快速开始 安装 最简示例 运行效果： --- 📖 使用指南 发送文本消息 发送图片 发送文件/语音/视频 使用中间件 限流中间件 --- ⚙️ 配置选项 Option 说明 默认值 -------- ------ -------- WithBaseURL(url) API 服务器地址 https://ilinkai.weixin.qq.com WithTokenFile(path) 凭证文件路径 .weixin-token.json WithContextTokenDir(dir) context token 目录 .wechat-context-tokens WithHTTPClient(client) 自定义 HTTP 客户端 &http.Client{} WithLogger(logger) 自定义日志 slog.Default() --- 🔧 Bot API 方法 说明 ------ ------ NewBot(opts ...Option) 创建 Bot 实例 Login(ctx, onQRCode) 扫码登录 OnMessage(handler) 注册消息处理回调 Use(middlewares ...) 注册中间件 Run(ctx) 启动（阻塞） Stop() 停止轮询 Reply(ctx, msg, text) 回复消息 SendTextToUser(ctx, userID, text) 主动发送 SendTyping(ctx, userID) 显示\"正在输入\" SendImageFromPath(ctx, userID, path) 发送图片 SendFileFromPath(ctx, userID, path) 发送文件 --- 📁 项目结构 --- 📚 文档 - Wiki 首页 - 架构设计 - 中间件指南 --- 📄 License MIT License - 详见 LICENSE 文件 --- English Go SDK for WeChat Bot based on Tencent's official iLink Bot API. iLink API Reference Features - QR code login with automatic credential persistence - Long-polling message reception with auto-reconnect - Context token persistence for proactive messaging - Typing indicator support - Rich media: images, voice, video, fil","default_branch":null,"files":null,"tree":[],"storefront":"/r/SpellingDragon","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/SpellingDragon/wechat-robot-go/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}