Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/modules/mcbbs_news/__init__.py
2022-05-22 00:04:29 +08:00

25 lines
686 B
Python

from core.component import on_command
from core.elements import MessageSession
from .mcbbs_news import news
mcbbs_news = on_command(
bind_prefix='mcbbs_news',
alias=['mn', 'mcbbsnews'],
desc='获得 MCBBS 幻翼快讯版最新新闻(未被版主高亮过的新闻将被忽略)',
developers=['Dianliang233']
)
@mcbbs_news.handle()
async def main(msg: MessageSession):
res = await news()
print('res' + str(res))
if res is None:
message = '没有找到任何新闻。'
else:
lst = []
for i in res:
lst += [f'{i["count"]}. {i["title"]} - {i["url"]}']
message = '\n'.join(lst)
await msg.finish(message)