Mark state refresh methods as private with an underscore

People kept wondering what it is or what it does.
This commit is contained in:
Rapptz
2022-03-14 07:31:21 -04:00
parent 6dd8845e4f
commit 934ab4151a
6 changed files with 14 additions and 14 deletions

View File

@ -171,7 +171,7 @@ class Modal(View):
print(f'Ignoring exception in modal {self}:', file=sys.stderr)
traceback.print_exception(error.__class__, error, error.__traceback__, file=sys.stderr)
def refresh(self, components: Sequence[ModalSubmitComponentInteractionDataPayload]) -> None:
def _refresh(self, components: Sequence[ModalSubmitComponentInteractionDataPayload]) -> None:
for component in components:
if component['type'] == 1:
self.refresh(component['components'])
@ -180,7 +180,7 @@ class Modal(View):
if item is None:
_log.debug("Modal interaction referencing unknown item custom_id %s. Discarding", component['custom_id'])
continue
item.refresh_state(component) # type: ignore
item._refresh_state(component) # type: ignore
async def _scheduled_task(self, interaction: Interaction):
try: