|
@@ -30,6 +30,7 @@ msg_slice = max_msg_len - len(split_text)
|
|
|
|
|
|
|
|
|
class GroupMeMessage(BaseModel):
|
|
|
+ id: str
|
|
|
sender_id: str
|
|
|
group_id: str
|
|
|
name: str
|
|
@@ -61,6 +62,7 @@ class GroupMeBot(rollbot.Rollbot[GroupMeMessage]):
|
|
|
sender_name=msg.name,
|
|
|
text=msg.text,
|
|
|
attachments=[rollbot.Attachment(d["type"], json.dumps(d)) for d in msg.attachments],
|
|
|
+ message_id=msg.id,
|
|
|
)
|
|
|
|
|
|
async def upload_image(self, data: bytes):
|
|
@@ -118,13 +120,12 @@ class GroupMeBot(rollbot.Rollbot[GroupMeMessage]):
|
|
|
else:
|
|
|
attachments.append({"type": "image", "url": att.body})
|
|
|
if att.name == "reply":
|
|
|
- if not isinstance(att.body, str):
|
|
|
- raise ValueError("Invalid reply body type")
|
|
|
- message += att.body # append reply text to response
|
|
|
+ if att.body is None or not isinstance(att.body, str):
|
|
|
+ raise ValueError("Invalid reply body type, must be message ID")
|
|
|
attachments.append({
|
|
|
"type": "reply",
|
|
|
- "base_reply_id": res.channel_id,
|
|
|
- "reply_id": res.channel_id,
|
|
|
+ "base_reply_id": att.body,
|
|
|
+ "reply_id": att.body,
|
|
|
})
|
|
|
|
|
|
except:
|