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.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
55and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
66
7+ # [ UNRELEASED]
8+
9+ ### Changed
10+
11+ - Changelog command can now take a version argument to jump straight to specified version.
712
813# v3.0.3
914
Original file line number Diff line number Diff line change @@ -224,11 +224,24 @@ def cog_unload(self):
224224 @commands .command ()
225225 @checks .has_permissions (PermissionLevel .REGULAR )
226226 @trigger_typing
227- async def changelog (self , ctx ):
227+ async def changelog (self , ctx , version = None ):
228228 """Shows the changelog of the Modmail."""
229229 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+
230242 try :
231243 paginator = PaginatorSession (ctx , * changelog .embeds )
244+ paginator .current = index
232245 await paginator .run ()
233246 except :
234247 await ctx .send (changelog .CHANGELOG_URL )
You can’t perform that action at this time.
0 commit comments