Add device-bound robot notifications and automatic OAuth cards
This commit is contained in:
@@ -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', {})
|
||||
|
||||
Reference in New Issue
Block a user