added names to async
This commit is contained in:
parent
e6108ca04d
commit
77373d36c4
@ -183,4 +183,12 @@ class Async:
|
||||
target = target.lower()
|
||||
if target.startswith('#'):
|
||||
return self.async_who_channel(channel=target, timeout=timeout)
|
||||
return None
|
||||
return None
|
||||
|
||||
@dec.extend
|
||||
async def names(self, target: str):
|
||||
"""Retrieve the list of users in a channel."""
|
||||
result = await self.who(target)
|
||||
if result and 'users' in result:
|
||||
return {'names': [user['nick'] for user in result['users']]}
|
||||
return {'names': []}
|
||||
|
Loading…
Reference in New Issue
Block a user