Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改参数名拼写错误和时间配置规范 #156

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
@@ -1,5 +1,5 @@
![python_vesion](https://img.shields.io/badge/Python-3.5%2B-green.svg) [![itchat_vesion](https://img.shields.io/badge/Itchat-1.3.10-brightgreen.svg)](https://github.com/littlecodersh/ItChat) [![codebeat badge](https://codebeat.co/badges/0953014f-dbd3-41f4-bacd-60018e7d5065)](https://codebeat.co/projects/github-com-sfyc23-everydaywechat-master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a278078ba9a14e22bd86740b0807a78e)](https://www.codacy.com/app/sfyc23/EverydayWechat?utm_source=github.com&utm_medium=referral&utm_content=sfyc23/EverydayWechat&utm_campaign=Badge_Grade) [![MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/sfyc23/EverydayWechat/blob/master/LICENSE) [![weibo](https://img.shields.io/badge/[email protected])](https://www.weibo.com/sfyc23) [![GitHub issues](https://img.shields.io/github/issues/sfyc23/EverydayWechat.svg)](https://github.com/sfyc23/EverydayWechat/issues) [![GitHub contributors](https://img.shields.io/github/contributors/sfyc23/EverydayWechat.svg)](https://github.com/sfyc23/EverydayWechat/graphs/contributors) [![微信群](http://vlog.sfyc23.xyz/wechat_everyday/wxgroup_logo.png?imageView2/0/w/60/h/20)](#微信交流群)

[EverydayWechat](https://github.com/sfyc23/EverydayWechat) 是基于 Python3 与 [Itchat](https://github.com/littlecodersh/ItChat) 的微信小工具。
可以定时给朋友或者群聊发送每日天气、提醒、每日一句,也可以智能自动回复好友信息。
操作简单,小白用户也可快速上手。
Expand Down Expand Up @@ -130,7 +130,7 @@ alarm_info:
填写好友信息,例如:
```
alarm_timed:
- "9:00"
- "09:00"
- "12:30"
- "22:00"
wechat_name:
Expand All @@ -152,7 +152,7 @@ sweet_words: '你脚下的蚂蚁'
| 名称 | 示例 | 必填 | 说明 |
| -------- | -------------- | ---------- |---------- |
| wechat_name | '老婆' | 选填 | 好友名:可填多人。好友微信昵称或者备注名(不能输入微信号)|
| alarm_timed | '9:30' | 必填 | 定时时间,可填多个 |
| alarm_timed | '09:30' | 必填 | 定时时间,可填多个 |
| group_name | '交流群' | 选填 | 群聊名称,可填多个。必须要把需要的群聊保存到通讯录。|
| city_name | '成都' | 可空 | 城市名:朋友所在城市,用于发送天气。 |
| dictum_channel | 2 | 可空 | 格言渠道(见下表)|
Expand All @@ -171,7 +171,7 @@ sweet_words: '你脚下的蚂蚁'

- **alarm_time** 设置成需要提醒的时间。之后如果微信没有断线,即每天这个的时间会定时发送提醒。

> 如果需要快速体验,可将 **alarm_timed** 当前系统时间之后的几分钟。例如当前时间为 11:35,并设置 5 分钟后发送提醒,即:alarm_timed:1140
> 如果需要快速体验,可将 **alarm_timed** 当前系统时间之后的几分钟。例如当前时间为 11:35,并设置 5 分钟后发送提醒,即:alarm_timed:11:40

当然,也可设置另一套不同的方案。具体参考代码。

Expand Down
6 changes: 3 additions & 3 deletions everyday_wechat/main.py
Expand Up @@ -263,16 +263,16 @@ def exit_msg():
set_system_notice('项目已断开连接')


def get_group(gruop_name, update=False):
def get_group(group_name, update=False):
"""
根据群组名获取群组数据
:param wechat_name:str, 群组名
:param update: bool 强制更新群组数据
:return: obj 单个群组信息
"""
if update: itchat.get_chatrooms(update=True)
if not gruop_name: return None
groups = itchat.search_chatrooms(name=gruop_name)
if not group_name: return None
groups = itchat.search_chatrooms(name=group_name)
if not groups: return None
return groups[0]

Expand Down