Repository: Cog-Creators/Red-DiscordBot

Issue:
Improve help of `[p]tempban` (possibly add example usage?)
# Command bugs

It is not obvious how `[p]tempban` should be used due to how argument parsing is configured for `duration` and `days` arguments with avoiding one eating the other in mind.
I think adding an explanation for the argument format and some examples of usage could really help with this.

#### Command name

`[p]tempban`

#### What cog is this command from?

Mod


Discussion:
Would you also be down to improve all ban commands and kick command with examples of how to use?

I wanna look into doing this one, but also wanna wait incase someone else wanna try to do their first pr.
> Would you also be down to improve all ban commands and kick command with examples of how to use?

Sure! Having examples in more commands seems like a nice improvement.

> I wanna look into doing this one, but also wanna wait incase someone else wanna try to do their first pr.

If you want to do it, don't worry about that, there's always something else new contributors can take on, we have a looot of documentation that isn't all that good anyway :)
> If you want to do it, don't worry about that, there's always something else new contributors can take on, we have a looot of documentation that isn't all that good anyway :)

Okay, sounds good. I'll do it tonight. :)

Resolving patch:
diff --git a/redbot/cogs/mod/kickban.py b/redbot/cogs/mod/kickban.py
--- a/redbot/cogs/mod/kickban.py
+++ b/redbot/cogs/mod/kickban.py
@@ -263,7 +263,14 @@ async def check_tempban_expirations(self):
     @commands.bot_has_permissions(kick_members=True)
     @checks.admin_or_permissions(kick_members=True)
     async def kick(self, ctx: commands.Context, user: discord.Member, *, reason: str = None):
-        """Kick a user.
+        """
+        Kick a user.
+
+        Examples:
+           - `[p]kick 428675506947227648 wanted to be kicked.`
+            This will kick Twentysix from the server.
+           - `[p]kick @Twentysix wanted to be kicked.`
+            This will kick Twentysix from the server.
 
         If a reason is specified, it will be the reason that shows up
         in the audit log.
@@ -342,11 +349,18 @@ async def ban(
     ):
         """Ban a user from this server and optionally delete days of messages.
 
-        A user ID should be provided if the user is not a member of this server.
+        `days` is the amount of days of messages to cleanup on ban.
 
-        If days is not a number, it's treated as the first word of the reason.
+        Examples:
+           - `[p]ban 428675506947227648 7 Continued to spam after told to stop.`
+            This will ban Twentysix and it will delete 7 days worth of messages.
+           - `[p]ban @Twentysix 7 Continued to spam after told to stop.`
+            This will ban Twentysix and it will delete 7 days worth of messages.
 
-        Minimum 0 days, maximum 7. If not specified, defaultdays setting will be used instead."""
+        A user ID should be provided if the user is not a member of this server.
+        If days is not a number, it's treated as the first word of the reason.
+        Minimum 0 days, maximum 7. If not specified, the defaultdays setting will be used instead.
+        """
         guild = ctx.guild
         if days is None:
             days = await self.config.guild(guild).default_days()
@@ -373,8 +387,15 @@ async def massban(
     ):
         """Mass bans user(s) from the server.
 
+        `days` is the amount of days of messages to cleanup on massban.
+
+        Example:
+           - `[p]massban 345628097929936898 57287406247743488 7 they broke all rules.`
+            This will ban all the added userids and delete 7 days of worth messages.
+
         User IDs need to be provided in order to ban
-        using this command."""
+        using this command.
+        """
         banned = []
         errors = {}
         upgrades = []
@@ -536,7 +557,19 @@ async def tempban(
         *,
         reason: str = None,
     ):
-        """Temporarily ban a user from this server."""
+        """Temporarily ban a user from this server.
+
+        `duration` is the amount of time the user should be banned for.
+        `days` is the amount of days of messages to cleanup on tempban.
+
+        Examples:
+           - `[p]tempban @Twentysix Because I say so`
+            This will ban Twentysix for the default amount of time set by an administrator.
+           - `[p]tempban @Twentysix 15m You need a timeout`
+            This will ban Twentysix for 15 minutes.
+           - `[p]tempban 428675506947227648 1d2h15m 5 Evil person`
+            This will ban the user for 1 day 2 hours 15 minutes and will delete the last 5 days of their messages.
+        """
         guild = ctx.guild
         author = ctx.author
 


Test patch: