Skip to content

Commit

Permalink
新增当host_id为None时的兼容
Browse files Browse the repository at this point in the history
  • Loading branch information
lunzhiPenxil committed Dec 5, 2023
1 parent 5350942 commit acaf623
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion OlivOSOnebotV11/eventRouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ def getHostIdDict(botHash, groupId):
if botHash in OlivOSOnebotV11.main.hostIdDict:
if str(groupId) in OlivOSOnebotV11.main.hostIdDict[botHash]:
res = OlivOSOnebotV11.main.hostIdDict[botHash][str(groupId)]
if res == 'None':
res = None
return res

def setMappingIdDict(botHash:str, id):
Expand All @@ -286,7 +288,10 @@ def setMappingIdDict(botHash:str, id):
return targetId

def getMappingIdDict(botHash:str, id):
return OlivOSOnebotV11.main.mappingIdDict.get(botHash, {}).get(str(id), id)
res = OlivOSOnebotV11.main.mappingIdDict.get(botHash, {}).get(str(id), id)
if res == 'None':
res = None
return res

def updateEventRegDict(botHash:str, key:str, event):
OlivOSOnebotV11.main.eventRegDict.setdefault(botHash, {})
Expand Down

0 comments on commit acaf623

Please sign in to comment.