Skip to content

Commit

Permalink
fix: /house and strip
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluefissure committed Jan 16, 2024
1 parent b49fd28 commit 424d763
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion ffxivbot/api_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ def serialize_cq(self, message):
},
}
)
reply_ptn = r"\[CQ:reply,id=(\d+)\]"
reply_match = re.search(reply_ptn, msg)
if reply_match:
reply_id = reply_match.group(1)
msg = re.sub(reply_ptn, "", msg)
msg_list.append(
{
"type": "reply",
"data": {
"id": reply_id,
},
}
)
msg = msg.strip()
if msg:
msg_list.append(
{
Expand All @@ -58,7 +72,6 @@ def serialize_cq(self, message):
},
}
)
print("msg_list:{}".format(json.dumps(msg_list, indent=2)))
return msg_list


Expand Down
2 changes: 1 addition & 1 deletion ffxivbot/handlers/QQCommand_house.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_round_ending():
if now_time < SOME_ROUND_ENDING:
return SOME_ROUND_ENDING
ending = SOME_ROUND_ENDING
while ending + 86400 * 9 < now_time:
while ending < now_time:
ending += 86400 * 9
return ending

Expand Down

0 comments on commit 424d763

Please sign in to comment.