Skip to content
This repository was archived by the owner on Nov 22, 2021. It is now read-only.

Commit 2b1223f

Browse files
authored
Merge pull request #61 from parafoxia/v1.2
Merge extra 1.2 changes before release
2 parents e6b2559 + f1cedd0 commit 2b1223f

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

solaris/bot/cogs/help.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ def full_syntax(ctx, cmd, prefix):
102102
if (p := cmd.parent) is None:
103103
return f"```{prefix}{invokations} {cmd.signature}```"
104104
else:
105-
return f"```{prefix}|parent| {invokations} {cmd.signature}```"
105+
p_invokations = "|".join([p.name, *p.aliases])
106+
return f"```{prefix}{p_invokations} {invokations} {cmd.signature}```"
106107

107108
@staticmethod
108109
async def required_permissions(ctx, cmd):

solaris/bot/cogs/warn.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def on_ready(self):
4646
if not self.bot.ready.booted:
4747
self.bot.ready.up(self)
4848

49-
@commands.group(name="warn", invoke_without_command=True)
49+
@commands.group(name="warn", invoke_without_command=True, help="Warns one or more members in your server.")
5050
@checks.module_has_initialised(MODULE_NAME)
5151
@checks.author_can_warn()
5252
async def warn_group(
@@ -119,7 +119,7 @@ async def warn_group(
119119
f"{target.mention}, you have been warned for {warn_type} for the {string.ordinal(wc)} of {max_strikes or 3} times. You now have {points} of your allowed {max_points or 12} points."
120120
)
121121

122-
@warn_group.command(name="remove", aliases=["rm"])
122+
@warn_group.command(name="remove", aliases=["rm"], help="Removes a warning.")
123123
@checks.module_has_initialised(MODULE_NAME)
124124
@checks.author_can_warn()
125125
async def warn_remove_command(self, ctx, warn_id: str):
@@ -130,7 +130,7 @@ async def warn_remove_command(self, ctx, warn_id: str):
130130

131131
await ctx.send(f"{self.bot.tick} Warn {warn_id} removed.")
132132

133-
@warn_group.command(name="reset")
133+
@warn_group.command(name="reset", help="Resets a member's warnings.")
134134
@checks.module_has_initialised(MODULE_NAME)
135135
@commands.has_permissions(administrator=True)
136136
async def warn_reset_command(self, ctx, target: discord.Member):
@@ -143,7 +143,7 @@ async def warn_reset_command(self, ctx, target: discord.Member):
143143

144144
await ctx.send(f"{self.bot.tick} Warnings for {target.display_name} reset.")
145145

146-
@warn_group.command(name="list")
146+
@warn_group.command(name="list", help="Lists a member's warnings.")
147147
@checks.module_has_initialised(MODULE_NAME)
148148
@checks.author_can_warn()
149149
async def warn_list_command(self, ctx, target: t.Optional[t.Union[discord.Member, str]]):
@@ -186,7 +186,11 @@ async def warn_list_command(self, ctx, target: t.Optional[t.Union[discord.Member
186186
)
187187
)
188188

189-
@commands.group(name="warntype", invoke_without_command=True)
189+
@commands.group(
190+
name="warntype",
191+
invoke_without_command=True,
192+
help="Manages warn types. Use the command for information on available subcommands.",
193+
)
190194
@checks.module_has_initialised(MODULE_NAME)
191195
@checks.author_can_configure()
192196
async def warntype_group(self, ctx):
@@ -211,7 +215,7 @@ async def warntype_group(self, ctx):
211215
)
212216
)
213217

214-
@warntype_group.command(name="new")
218+
@warntype_group.command(name="new", help="Creates a new warn type.")
215219
@checks.module_has_initialised(MODULE_NAME)
216220
@checks.author_can_configure()
217221
async def warntype_new_command(self, ctx, warn_type: str, points: int):
@@ -244,7 +248,10 @@ async def warntype_new_command(self, ctx, warn_type: str, points: int):
244248
)
245249
await ctx.send(f'{self.bot.tick} The warn type "{warn_type}" has been created, and is worth {points} points.')
246250

247-
@warntype_group.command(name="edit")
251+
@warntype_group.command(
252+
name="edit",
253+
help="Edits an existing warn type. Existing warn records are updated to reflect the changes, but action is not retroactively taken based on point values.",
254+
)
248255
@checks.module_has_initialised(MODULE_NAME)
249256
@checks.author_can_configure()
250257
async def warntype_edit_command(self, ctx, warn_type: str, new_name: str, points: int):
@@ -280,7 +287,11 @@ async def warntype_edit_command(self, ctx, warn_type: str, new_name: str, points
280287
f'{self.bot.tick} The warn type "{new_name}" (formerly "{warn_type}") is now worth {points} points.'
281288
)
282289

283-
@warntype_group.command(name="delete", aliases=["del"])
290+
@warntype_group.command(
291+
name="delete",
292+
aliases=["del"],
293+
help="Deletes a warn type. Existing warn records are updated to reflect the changes, but action is not retroactively taken based on point values.",
294+
)
284295
@checks.module_has_initialised(MODULE_NAME)
285296
@checks.author_can_configure()
286297
async def warntype_delete_command(self, ctx, warn_type: str):
@@ -297,7 +308,7 @@ async def warntype_delete_command(self, ctx, warn_type: str):
297308
await self.bot.db.execute("DELETE FROM warns WHERE GuildID = ? AND WarnType = ?", ctx.guild.id, warn_type)
298309
await ctx.send(f'{self.bot.tick} Warn type "{warn_type}" deleted.')
299310

300-
@warntype_group.group(name="list")
311+
@warntype_group.group(name="list", help="Lists the server's warn types.")
301312
@checks.module_has_initialised(MODULE_NAME)
302313
@checks.author_can_configure()
303314
async def warntype_list_command(self, ctx):

0 commit comments

Comments
 (0)