Add device-bound robot notifications and automatic OAuth cards

This commit is contained in:
ex_tianzy
2026-10-28 16:33:14 +08:00
parent b774941890
commit f5a38e0808
19 changed files with 837 additions and 2 deletions
+9
View File
@@ -90,3 +90,12 @@ class Feishu:
await self._json("POST", f"/open-apis/im/v1/messages/{message_id}/reply",
headers={"Authorization": f"Bearer {token}"},
json={"msg_type": "text", "content": json.dumps({"text": text}, ensure_ascii=False)})
async def send(self, owner, msg_type, content, delivery_id, *, token=None):
token = token or await self.tenant_token()
data = await self._json('POST', '/open-apis/im/v1/messages',
params={'receive_id_type': 'open_id'},
headers={'Authorization': 'Bearer ' + token},
json={'receive_id': owner, 'msg_type': msg_type,
'content': json.dumps(content, ensure_ascii=False), 'uuid': delivery_id})
return data.get('data', {})