From 77373d36c4eff328cf349a80af8e469f99d7b30e Mon Sep 17 00:00:00 2001 From: Zodiac Date: Wed, 12 Feb 2025 23:05:15 -0800 Subject: [PATCH] added names to async --- plugins/asynchronious.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/asynchronious.py b/plugins/asynchronious.py index 3947068..857ab55 100644 --- a/plugins/asynchronious.py +++ b/plugins/asynchronious.py @@ -183,4 +183,12 @@ class Async: target = target.lower() if target.startswith('#'): return self.async_who_channel(channel=target, timeout=timeout) - return None \ No newline at end of file + 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': []}