not print url when no url

This commit is contained in:
felinae98 2021-02-19 00:39:34 +08:00
parent 6b91d52228
commit f2e6bea108
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610

View File

@ -29,10 +29,11 @@ class Post:
text += '\n{}'.format(self.text)
if self._use_pic():
msgs.append(await parse_text(text))
if not self.target_type == 'rss':
if not self.target_type == 'rss' and self.url:
msgs.append(self.url)
else:
text += '详情: {}'.format(self.url)
if self.url:
text += '详情: {}'.format(self.url)
msgs.append(text)
for pic in self.pics:
msgs.append("[CQ:image,file={url}]".format(url=pic))