Add JSON-RPC API can_send()

This commit is contained in:
link2xt
2023-04-14 20:10:18 +00:00
parent b369a30544
commit 28a13e98a6
4 changed files with 16 additions and 1 deletions

View File

@@ -105,6 +105,10 @@ class Chat:
info = await self._rpc.get_full_chat_by_id(self.account.id, self.id)
return AttrDict(chat=self, **info)
async def can_send(self) -> bool:
"""Return true if messages can be sent to the chat."""
return await self._rpc.can_send(self.account.id, self.id)
async def send_message(
self,
text: Optional[str] = None,