Skip to content

Commit 0a2a060

Browse files
author
xwqin
committed
fix: FileBox created without msg_id
1 parent a118af1 commit 0a2a060

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/wechaty/user/contact.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
# pytype: disable=pyi-error
6363
from .url_link import UrlLink
6464
from .mini_program import MiniProgram
65-
65+
6666

6767
log = get_logger('Contact')
6868

@@ -190,7 +190,7 @@ async def find(cls,
190190
191191
Args:
192192
query: the query body to build filter
193-
193+
194194
Examples:
195195
>>> # 1. find contacts based query string, will match one of: contact_id, weixin, name and alias
196196
>>> # what's more, contact_id and weixin will follow extract match, name and alias will follow fuzzy match
@@ -319,7 +319,7 @@ async def say(self, message: Union[str, Message, FileBox, Contact, UrlLink, Mini
319319
320320
Args:
321321
message: the message object to be sended to contact
322-
322+
323323
Examples:
324324
>>> contact = Contact.load('contact-id')
325325
>>> await contact.say('hello')
@@ -331,7 +331,7 @@ async def say(self, message: Union[str, Message, FileBox, Contact, UrlLink, Mini
331331
>>> await contact.say(MiniProgram('username', 'appid'))
332332
333333
Returns:
334-
Message: if the message is send successfully, return the message object, otherwise return None
334+
Message: if the message is send successfully, return the message object, otherwise return None
335335
"""
336336
if not message:
337337
log.error('can"t say nothing')
@@ -360,7 +360,7 @@ async def say(self, message: Union[str, Message, FileBox, Contact, UrlLink, Mini
360360
conversation_id=self.contact_id,
361361
file=message
362362
)
363-
363+
return None
364364
elif isinstance(message, UrlLink):
365365
# use this way to resolve circulation dependency import
366366
msg_id = await self.puppet.message_send_url(
@@ -390,7 +390,7 @@ def name(self) -> str:
390390
Examples:
391391
>>> contact = Contact.load('contact-id')
392392
>>> name: str = contact.name
393-
393+
394394
Returns:
395395
str: name of contact, if the payload is None, return empty string
396396
"""
@@ -403,7 +403,7 @@ async def alias(self,
403403
) -> Union[None, str]:
404404
"""
405405
Get or set alias of contact.
406-
406+
407407
If new_alias is given, it will set alias to new_alias,
408408
otherwise return current alias
409409
@@ -527,7 +527,7 @@ def star(self) -> Optional[bool]:
527527
def gender(self) -> ContactGender:
528528
"""
529529
Return the gender of contact.
530-
530+
531531
Returns:
532532
ContactGender: the object of contact gender
533533
"""
@@ -571,7 +571,7 @@ async def avatar(self, file_box: Optional[FileBox] = None) -> FileBox:
571571
Args:
572572
file_box: If given, it will set it as new avatar,
573573
else get the current avatar. Defaults to None.
574-
574+
575575
Examples:
576576
>>> contact = Contact.load('contact-id')
577577
>>> avatar = contact.avatar()
@@ -627,7 +627,7 @@ def weixin(self) -> Optional[str]:
627627
Examples:
628628
>>> contact = Contact.load('contact-id')
629629
>>> weixin = contact.weixin()
630-
630+
631631
Returns:
632632
identifier: the weixin union identifier of contact
633633
"""

0 commit comments

Comments
 (0)