mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-28 08:41:29 +00:00
Update demo
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
from aiocqhttp import Error as CQHttpError
|
||||
|
||||
from none import on_notice, NoticeSession, on_request, RequestSession
|
||||
from none.helpers import render_expression as __
|
||||
|
||||
GROUP_GREETING = (
|
||||
'欢迎新同学 {name}[]![CQ:face,id=63][CQ:face,id=63][CQ:face,id=63]',
|
||||
@ -18,7 +19,7 @@ async def _(session: NoticeSession):
|
||||
info = await session.bot.get_group_member_info(**session.ctx,
|
||||
no_cache=True)
|
||||
name = info['card'] or info['nickname'] or '新成员'
|
||||
await session.send_expr(GROUP_GREETING, name=name, **session.ctx)
|
||||
await session.send(__(GROUP_GREETING, name=name, **session.ctx))
|
||||
except CQHttpError:
|
||||
pass
|
||||
|
||||
|
Reference in New Issue
Block a user