__init__
PYL-W0201152 return interaction.user == self.ctx.author or gatekeeper.has(interaction.guild, interaction.user, 4)
153
154 async def on_timeout(self):
155 self.jump_button.disabled = True156 self.stopped = True
157 await self.refresh_response_message()
158 self.stop()
310 super().refresh_button_state()
311
312 async def on_timeout(self):
313 self.stopped = True314 await self.refresh_response_message()
315 self.stop()
316
215
216 async def on_timeout(self):
217 self.disabled = True
218 self.placeholder = "Timed out"219 if isinstance(self.ctx, GIRContext):
220 await self.ctx.edit(view=self._view)
221 else:
214 await self.ctx.interaction.response.edit_message(embed=await self.format_tweak_page(selected_value), view=self._view)
215
216 async def on_timeout(self):
217 self.disabled = True218 self.placeholder = "Timed out"
219 if isinstance(self.ctx, GIRContext):
220 await self.ctx.edit(view=self._view)
193 min_values=1, max_values=1, options=options)
194
195 def start(self, ctx):
196 self.ctx = ctx197
198 async def callback(self, interaction):
199 if interaction.user != self.author and not gatekeeper.has(interaction.guild, interaction.user, 4):
Defining an instance attribute outside __init__
affects the readability of code. It is expected to find all the attributes an instance may have by reading its __init__
method. If there is a need to initialize attribute via sub-initialization methods, it is recommended to assign attributes to None
in the init then call the sub-initialization methods.