whatever, group_id, user_id = event.get_session_id().split('_') data =awaitbot.call_api('get_group_member_list', **{'group_id':int(group_id) }) kr = rk.cursor() gid ="group"+ group_id#你表名咋写的就咋写rank_value = kr.execute(f"SELECT * from{gid}ORDER BY cishu DESC...
3.bot的使用 bot = nonebot.get_bot() info = await bot.get_group_member_info(group_id=62234565, user_id=448112234) await bot.send_group_msg(group_id=6227422, message='大家好~') # 发送群消息 # 监听消息 bot = nonebot.get_bot() # @bot.on_message('group') #监听群组消息 @bot.on_m...
get_group_member_info(group_id=group_id, user_id=event.self_id) # 管理员检测 if member_info['role'] != 'admin' and member_info['role'] != 'owner': return for seg in event.message: if seg.type == 'image' or seg.type == 'mface': async def handle_function( m: Matcher...
import... async def send(): msg = await eew() bot = nonebot.get_bot("1234567") await bot.send_group_msg(group_id=7654321, message=msg) async def eew(): def ew(): infotext = "hello" time.sleep(5) return infotext while True: return ew() Member cleoold commented Feb 20, 2023...
'''character_list = {}@update_ark.handle()asyncdefupdate_ark_handle(bot: Bot, event: Event):try: whatever, group_id, user_id = event.get_session_id().split('_')# 获取当前群聊id,发起人id,返回的格式为group_groupid_useriddata =awaitbot.call_api('get_group_member_list', **{'grou...
=None:# 如果消息时群聊事件,实际上有更好的解决办法,但是这里没用reciece_message =str(event.get_message())iflen(reciece_message) >4:awaitjrrp.finish() data =awaitbot.call_api('get_group_member_info', **{'group_id':int(group_id),'user_id':int(user_id)})"""call_api()...
friends = await bot.get_friend_list() ```也可以通过 `CQHttp.call_action` 方法调用 API,例如:```py await bot.call_action('set_group_whole_ban', group_id=10010) ```两种调用 API 的方法最终都通过 `CQHttp.api` 属性来向 CQHTTP 发送请求并获取调用结果。 """def __init__(self,...
whatever, group_id, user_id = event.get_session_id().split('_')# 获取当前群聊id,发起人id,返回的格式为group_groupid_useriddata =awaitbot.call_api('get_group_member_list', **{'group_id':int(group_id) })except:# 如果上面报错了,意味着发起的是私聊,返回格式为useridgroup_id =Noneus...
whatever, group_id, user_id = event.get_session_id().split('_')# 获取当前群聊id,发起人id,返回的格式为group_groupid_useriddata =awaitbot.call_api('get_group_member_list', **{'group_id':int(group_id) })except:# 如果上面报错了,意味着发起的是私聊,返回格式为useridgroup_id =Noneus...