added names to async

This commit is contained in:
Zodiac 2025-02-12 23:05:15 -08:00
parent e6108ca04d
commit 77373d36c4

View File

@ -183,4 +183,12 @@ class Async:
target = target.lower() target = target.lower()
if target.startswith('#'): if target.startswith('#'):
return self.async_who_channel(channel=target, timeout=timeout) 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': []}