iuiaoin / wechat-gptbot

A wechat robot based on ChatGPT with no risk, very stable! 🚀
MIT License
583 stars 115 forks source link

[Feat]: 希望插件系统能够支持系统级定时器及通过配置文件指定私聊或群聊对象 #55

Closed goxofy closed 1 year ago

goxofy commented 1 year ago

Search for answers in existing issues

Feature description

具体来说就是我实现了一个早报的功能,但是目前只能通过指定command来触发。

希望插件系统能够从接口层面支持两个功能 1.定时器 2.指定发送对象

以此来实现每天早上9:00自动发送新闻早报到指定的私聊/群聊对象。

Motivation

No response

iuiaoin commented 1 year ago

这两个功能可以(并且应该)在插件内部实现:

  1. 在plugin的init中调用schedule module和WeChatChannel().send即可
  2. 把需要指定的wx_id或group_id加入插件的config中, 前面的id可以通过在私聊或群聊中发个消息获取(控制台会打印出来)
goxofy commented 1 year ago

这两个功能可以(并且应该)在插件内部实现:

  1. 在plugin的init中调用schedule module和WeChatChannel().send即可
  2. 把需要指定的wx_id或group_id加入插件的config中, 前面的id可以通过在私聊或群聊中发个消息获取(控制台会打印出来)

好的我试试谢谢,python 入门级别😄

goxofy commented 1 year ago

@iuiaoin 大佬能给写个定时发送到指定对象的 demo 吗?研究了几天没搞定

iuiaoin commented 1 year ago

@goxofy 写了个例子,可以参考一下 https://github.com/iuiaoin/plugin_weather

goxofy commented 1 year ago

@iuiaoin 感谢!