Giter Club home page Giter Club logo

wechatrobot's Introduction

WeChatRobot

一个基于 WeChatFerry 的微信机器人示例。

📖 文档 📺 视频教程 🙋 FAQ 🚨【微信机器人】沙雕行为合集
碲矿 赞赏
后台回复 WeChatFerry 加群交流 如果你觉得有用

Quick Start

  1. 安装 Python,例如 3.10.11
  2. 安装微信 3.9.2.23,下载地址在 这里;也可以从 WeChatSetup 找到。
  3. 克隆项目
git clone https://github.com/lich0821/WeChatRobot.git

# 如果网络原因打不开,可以科学上网,或者使用gitee
git clone https://gitee.com/lch0821/WeChatRobot.git

如果觉得克隆复杂,也可以直接下载最新版 (打不开试试这个) 到本地解压。

  1. 安装依赖
# 升级 pip
python -m pip install -U pip
# 安装必要依赖
pip install -r requirements.txt
  1. 运行

直接运行程序会自动拉起微信:

python main.py
# 如果微信未打开,会自动打开微信;如果版本不对,也会有提示;其他报错,请进群交流。

修改配置

配置文件 config.yaml 是运行程序后自动从模板复制过来的,以下功能默认关闭。

  • 为了响应群聊消息,需要添加相应的 roomId(打印的消息中方括号里的就是):
groups:
  enable: [] # 允许响应的群 roomId,大概长这样:2xxxxxxxxx3@chatroom
  • 为了使用 ChatGPT,需要取消配置中 chatgpt 的注释, 并配置 OpenAI 的 Key(以及代理):
# 如果要使用 ChatGPT,取消下面的注释并填写相关内容
chatgpt:
  key: 填写你 ChatGPT 的 key
  api: https://api.openai.com/v1 # 如果你不知道这是干嘛的,就不要改
  proxy: # 如果你在国内,你可能需要魔法,大概长这样:http://域名或者IP地址:端口号
  prompt: 你是智能聊天机器人,你叫wcferry # 根据需要对角色进行设定
  • 为了暴露 HTTP 接口,需要取消配置中 http 的注释:

如有需要,推荐使用 wcfhttp

PyPi Downloads Documentation Status

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.