File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
7
+ # [ UNRELEASED]
8
+
9
+ ### Changed
10
+
11
+ - Changelog command can now take a version argument to jump straight to specified version.
7
12
8
13
# v3.0.3
9
14
Original file line number Diff line number Diff line change @@ -224,11 +224,24 @@ def cog_unload(self):
224
224
@commands .command ()
225
225
@checks .has_permissions (PermissionLevel .REGULAR )
226
226
@trigger_typing
227
- async def changelog (self , ctx ):
227
+ async def changelog (self , ctx , version = None ):
228
228
"""Shows the changelog of the Modmail."""
229
229
changelog = await Changelog .from_url (self .bot )
230
+ version = version .lstrip ("vV" ) if version else changelog .latest_version .version
231
+
232
+ try :
233
+ index = [v .version for v in changelog .versions ].index (version )
234
+ except ValueError :
235
+ return await ctx .send (
236
+ embed = Embed (
237
+ color = Color .red (),
238
+ description = f"The specified version `{ version } ` could not be found." ,
239
+ )
240
+ )
241
+
230
242
try :
231
243
paginator = PaginatorSession (ctx , * changelog .embeds )
244
+ paginator .current = index
232
245
await paginator .run ()
233
246
except :
234
247
await ctx .send (changelog .CHANGELOG_URL )
You can’t perform that action at this time.
0 commit comments