Comments (4)
我没有用过腾讯云的定时器(看了下文档好像和linux自带的crontab差不多),不过看你的需求应该是在特定时间段发送消息是吧? 这个功能的实现应该有很多选项,例如crontab
(定时执行脚本),python的apscheduler
(定时任务库) ,这些都可以达到你需要的定时回复任务。这些内容网上有很多教程可以参考。
我个人推荐使用crontab
,你可以先利用corpwechatbot
编写好一个python
脚本,例如hello.py
(功能是发送你好到企业微信) ,然后我希望每天9: 00 都能定时收到该信息,在linux终端输入crontab -e
,填入如下信息:
0 9 * * * python3 hello.py
from corpwechatbot.
谢谢您的指点,请问下个版本可以设置成可以同时配置好几个发送信息,然后随机挑一条发送过去吗
from corpwechatbot.
同时配置好几个消息随机发送,不知道为什么会有这个需求?(想不到使用场景)像接口一次性传入多个消息(例如消息队列),然后逐条发送,这种是会考虑的,但是不知道随机是有什么作用,不过这个问题现在也很好解决,只要你自己设置一个消息列表,例如:
msgs = [
'hello',
'world',
'nice to meet u',
]
然后在发送前你用random函数初始化一个种子,从消息列表中随机取出一条消息(可以通过索引下标也可以直接通过列表随机取元素),用send_xxx()
方法发送即可,并不需要专门为这个做开发,希望能解答你的疑惑。
from corpwechatbot.
我想搞一个以我家猫的角度定时提醒摸他的提示,所以可能换几个内容比较好一些。我不懂py,谢谢你的思路,我去查文档研究一下
from corpwechatbot.
Related Issues (20)
- 用于回调消息的示例代码web.py运行出错 HOT 2
- 可以实现消息自动回复吗? HOT 1
- 能否开发下接收消息?
- 企业微信接收信息功能 HOT 5
- 终于找到了这个东西,先谢谢老板~~研究到最后发现回调配置的url需要企业关联域名直接GG HOT 2
- centos运行时发送markdown报Filename too long HOT 1
- touser为空列表 HOT 1
- 能发消息到我的私人微信客户端吗? HOT 11
- 群机器人 HOT 2
- cropwechatbot
- corpwechatbot-web 的参考文档可否副本一份在墙内友好的地址呢?
- 电脑上开了clash代理,然后就会报错 HOT 1
- mpnews,多条图文消息问题
- 希望增加素材管理功能,如上传图片
- 因为是局域网,想用bot发送消息,但是只能是默认的群,不能指定其他群机器人 HOT 1
- 大佬能支持下mpnews这种类型的图文发送吗 拜托感谢 HOT 8
- 有没有计划出搭建服务端的功能? HOT 3
- access_token missing HOT 3
- access_token和token
- 创建多个企业微信应用实例后,token过期问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corpwechatbot.