mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
New generation init
This commit is contained in:
12
none/helpers.py
Normal file
12
none/helpers.py
Normal file
@ -0,0 +1,12 @@
|
||||
from typing import Dict, Any
|
||||
|
||||
|
||||
def context_source(ctx: Dict[str, Any]) -> str:
|
||||
src = ''
|
||||
if ctx.get('group_id'):
|
||||
src += 'g%s' % ctx['group_id']
|
||||
elif ctx.get('discuss_id'):
|
||||
src += 'd%s' % ctx['discuss_id']
|
||||
if ctx.get('user_id'):
|
||||
src += 'p%s' % ctx['user_id']
|
||||
return src
|
Reference in New Issue
Block a user