Skip to content

Commit

Permalink
feat(Action.sendGroupPic): send multiple picture
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyaowong committed Nov 13, 2020
1 parent 9e719ec commit b4e6724
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion botoy/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pylint: disable=C0415,C0413
__version__ = '0.0.14'
__version__ = '0.0.15'


def check_version():
Expand Down
16 changes: 15 additions & 1 deletion botoy/action.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import collections
import time
import traceback
from typing import List, Union
Expand Down Expand Up @@ -111,13 +112,26 @@ def sendGroupPic(
picUrl: str = '',
picBase64Buf: str = '',
fileMd5: str = '',
picMd5s: Union[str, List[str]] = '',
flashPic=False,
atUser: Union[int, List[int]] = 0,
) -> dict:
"""发送群组图片消息"""
assert any([picUrl, picBase64Buf, fileMd5]), '缺少参数'
assert any([picUrl, picBase64Buf, fileMd5, picMd5s]), '缺少参数'
if atUser != 0:
content = macro.atUser(atUser) + '\n' + content
if picMd5s:
if not isinstance(picMd5s, collections.Sequence):
picMd5s = [picMd5s]
return self.post(
'SendMsgV2',
{
"ToUserUid": group,
"SendToType": 2,
"SendMsgType": "PicMsg",
"PicMd5s": picMd5s,
},
)
return self.post(
'SendMsg',
{
Expand Down

0 comments on commit b4e6724

Please sign in to comment.