@@ -376,6 +376,43 @@ async def senduserimage(a, event, data):
376376 return a
377377
378378
379+ async def sendpoke (a , event , data ):
380+ """
381+ 用于执行发送戳一戳\n
382+ :param a: 传入$函数 参数$里面的参数
383+ :param event: 事件对象
384+ :param data: 传入正则匹配到的字符串
385+ """
386+ match = re .search (r'^$(\w+)\s+(.+)$$' ,a )
387+ if match :
388+ func_name , param = match .groups ()
389+ user_id = await my_function (func_name , param , event ,data )
390+ elif a == "QQ" :
391+ user_id = event .user_id
392+ else :
393+ logger .opt (colors = True ).error (f"<yellow>异常!</yellow>参数:<blue>{ a } </blue><red> 无法解析</red>" )
394+ return None
395+ (bot ,) = nonebot .get_bots ().values ()
396+ try :
397+ await bot .call_api ("group_poke" , group_id = event .group_id , user_id = user_id )
398+ except nonebot .adapters .onebot .v11 .exception .NetworkError :
399+ logger .opt (colors = True ).error (f"<yellow>异常!</yellow>参数:<blue>{ a } </blue><red> 网络错误</red>" )
400+ return None
401+
402+ async def getat (a , event , data ):
403+ """
404+ 用于执行获取艾特对象的QQ号\n
405+ :param a: 传入$函数 参数$里面的参数
406+ :param event: 事件对象
407+ :param data: 传入正则匹配到的字符串
408+ """
409+ if len (at := event .original_message .include ("at" )) > 0 :
410+ try :
411+ id = at [int (a )].data ["qq" ]
412+ return str (id )
413+ except IndexError :
414+ logger .opt (colors = True ).error (f"<yellow>异常!</yellow>参数:<blue>{ a } </blue><red> 无法解析</red>" )
415+
379416def is_quote (s ):
380417 """
381418 用于判断list是为[1,2]还是['1','2']方便进行参数自动修正\n
0 commit comments