mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-05 19:36:43 +08:00
add log for cancel top
This commit is contained in:
parent
dc6a4511eb
commit
0d6c64110a
@ -5,6 +5,7 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from bs4 import BeautifulSoup as bs
|
from bs4 import BeautifulSoup as bs
|
||||||
import httpx
|
import httpx
|
||||||
|
from nonebot import logger
|
||||||
|
|
||||||
from ..post import Post
|
from ..post import Post
|
||||||
from ..types import *
|
from ..types import *
|
||||||
@ -92,6 +93,10 @@ class Weibo(Platform):
|
|||||||
res = await super().filter_common(target, raw_post_list)
|
res = await super().filter_common(target, raw_post_list)
|
||||||
if (self.top[target] is not None and new_post is None) or \
|
if (self.top[target] is not None and new_post is None) or \
|
||||||
(self.top[target] is not None and new_post is not None and self.get_id(self.top[target]) != self.get_id(new_post)):
|
(self.top[target] is not None and new_post is not None and self.get_id(self.top[target]) != self.get_id(new_post)):
|
||||||
|
if new_post:
|
||||||
|
logger.info('cancel top: {}'.format(new_post))
|
||||||
|
else:
|
||||||
|
logger.info('cancel top: {}'.format(raw_post_list))
|
||||||
res.append({'_type': 50, 'target': self.top[target]['mblog']['user']['screen_name']})
|
res.append({'_type': 50, 'target': self.top[target]['mblog']['user']['screen_name']})
|
||||||
self.top[target] = new_post
|
self.top[target] = new_post
|
||||||
return res
|
return res
|
||||||
|
Loading…
x
Reference in New Issue
Block a user