|
@@ -76,16 +76,18 @@ class GroupMeBot(rollbot.Rollbot[GroupMeMessage]):
|
|
|
return (await upload.json())["payload"]["url"]
|
|
|
|
|
|
async def post_message(self, bot_id: str, text: str, attachments: list[dict[str, str]]):
|
|
|
+ body = {
|
|
|
+ "bot_id": bot_id,
|
|
|
+ "text": text,
|
|
|
+ "attachments": attachments,
|
|
|
+ }
|
|
|
+ self.context.logginer.info(f"Sending: {body}")
|
|
|
result = await self.context.request.post(
|
|
|
"https://api.groupme.com/v3/bots/post",
|
|
|
- json={
|
|
|
- "bot_id": bot_id,
|
|
|
- "text": text,
|
|
|
- "attachments": attachments,
|
|
|
- },
|
|
|
+ json=body,
|
|
|
timeout=10,
|
|
|
)
|
|
|
- self.context.logger.info(f"{result.status} - {await result.json()}")
|
|
|
+ self.context.logger.info(f"Received: {result.status} - {await result.json()}")
|
|
|
|
|
|
async def respond(self, res: rollbot.Response):
|
|
|
# sleep for a moment to make groupme not misorder messages
|