mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-08 04:55:51 +08:00
🐛 修复原神公告
(#604)
This commit is contained in:
parent
c268a9f020
commit
1f5ff52644
@ -29,11 +29,11 @@ async def ann_(bot: Bot, ev: Event):
|
||||
img = await convert_img(img)
|
||||
return await bot.send(img)
|
||||
|
||||
ann_id = ann_id.replace('#', '')
|
||||
if not ann_id.isdigit():
|
||||
raise Exception('公告ID不正确')
|
||||
|
||||
img = await ann_detail_card(int(ann_id))
|
||||
img = await convert_img(img)
|
||||
await bot.send(img)
|
||||
|
||||
|
||||
|
@ -93,15 +93,18 @@ async def ann_detail_card(ann_id):
|
||||
for a in soup.find_all('a'):
|
||||
a.string = ''
|
||||
|
||||
for img in soup.find_all('img'):
|
||||
img.string = img.get('src')
|
||||
|
||||
msg_list = [ann_img]
|
||||
msg_list += [
|
||||
for img in soup.find_all('img'):
|
||||
msg_list.append(img.get('src'))
|
||||
# img.string = img.get('src')
|
||||
|
||||
msg_list.extend(
|
||||
[
|
||||
BeautifulSoup(x.get_text('').replace('<<', ''), 'lxml').get_text()
|
||||
+ '\n'
|
||||
for x in soup.find_all('p')
|
||||
]
|
||||
)
|
||||
|
||||
drow_height = 0
|
||||
for msg in msg_list:
|
||||
|
Loading…
x
Reference in New Issue
Block a user