aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kosayoda <[email protected]>2020-07-14 10:51:56 +0800
committerGravatar kosayoda <[email protected]>2020-07-14 10:51:56 +0800
commit7ff8b2c9ebc27194835c25258bc90c623bdbec6b (patch)
tree064148635e8ce59adc3a4494d99b51c3f6be8fc3
parentWhitelisting some popular communities (diff)
Allow ordering watched users by oldest first
-rw-r--r--bot/cogs/watchchannels/watchchannel.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bot/cogs/watchchannels/watchchannel.py b/bot/cogs/watchchannels/watchchannel.py
index 7c58a0fb5..2992a3085 100644
--- a/bot/cogs/watchchannels/watchchannel.py
+++ b/bot/cogs/watchchannels/watchchannel.py
@@ -287,7 +287,9 @@ class WatchChannel(metaclass=CogABCMeta):
await self.webhook_send(embed=embed, username=msg.author.display_name, avatar_url=msg.author.avatar_url)
- async def list_watched_users(self, ctx: Context, update_cache: bool = True) -> None:
+ async def list_watched_users(
+ self, ctx: Context, oldest_first: bool = False, update_cache: bool = True
+ ) -> None:
"""
Gives an overview of the watched user list for this channel.
@@ -305,7 +307,11 @@ class WatchChannel(metaclass=CogABCMeta):
time_delta = self._get_time_delta(inserted_at)
lines.append(f"• <@{user_id}> (added {time_delta})")
+ if oldest_first:
+ lines.reverse()
+
lines = lines or ("There's nothing here yet.",)
+
embed = Embed(
title=f"{self.__class__.__name__} watched users ({'updated' if update_cache else 'cached'})",
color=Color.blue()