@@ -111,12 +111,15 @@ async def zen(
111111 zen_lines = ZEN_OF_PYTHON .splitlines ()
112112
113113 # Prioritize checking for an index or slice
114- match = re .match (r"(?P<index>-?\d++(?!:))|(?P<start>(?:-\d+)|\d*):(?:(?P<end>(?:-\d+)|\d*)(?::(?P<step>(?:-\d+)|\d*))?)?" , search_value .split (" " )[0 ])
114+ match = re .match (
115+ r"(?P<index>-?\d++(?!:))|(?P<start>(?:-\d+)|\d*):(?:(?P<end>(?:-\d+)|\d*)(?::(?P<step>(?:-\d+)|\d*))?)?" ,
116+ search_value .split (" " )[0 ],
117+ )
115118 if match :
116119 if match .group ("index" ):
117120 index = int (match .group ("index" ))
118121 if not (- 19 <= index <= 18 ):
119- raise BadArgument (f "Please provide an index between { - 19 } and { 18 } ." )
122+ raise BadArgument ("Please provide an index between -19 and 18 ." )
120123 embed .title += f" (line { index % 19 } ):"
121124 embed .description = zen_lines [index ]
122125 await ctx .send (embed = embed )
@@ -127,12 +130,13 @@ async def zen(
127130 step_size = int (match .group ("step" )) if match .group ("step" ) else 1
128131
129132 if step_size == 0 :
130- raise BadArgument (f "Step size must not be 0." )
133+ raise BadArgument ("Step size must not be 0." )
131134
132135 lines = zen_lines [start_index :end_index :step_size ]
133136 if not lines :
134- raise BadArgument (f"Slice returned 0 lines." )
135- elif len (lines ) == 1 :
137+ raise BadArgument ("Slice returned 0 lines." )
138+
139+ if len (lines ) == 1 :
136140 embed .title += f" (line { zen_lines .index (lines [0 ])} ):"
137141 embed .description = lines [0 ]
138142 await ctx .send (embed = embed )
0 commit comments