@@ -360,7 +360,7 @@ def is_components_v2(self) -> bool:
360360 async def _scheduled_task (self , item : Item [V ], interaction : Interaction ):
361361 try :
362362 if self .timeout :
363- self .__timeout_expiry = time .monotonic () + self .timeout
363+ self ._timeout_expiry = time .monotonic () + self .timeout
364364
365365 allow = await self .interaction_check (interaction )
366366 if not allow :
@@ -371,26 +371,26 @@ async def _scheduled_task(self, item: Item[V], interaction: Interaction):
371371 return await self .on_error (e , item , interaction )
372372
373373 def _start_listening_from_store (self , store : ViewStore ) -> None :
374- self .__cancel_callback = partial (store .remove_view )
374+ self ._cancel_callback = partial (store .remove_view )
375375 if self .timeout :
376376 loop = asyncio .get_running_loop ()
377- if self .__timeout_task is not None :
378- self .__timeout_task .cancel ()
377+ if self ._timeout_task is not None :
378+ self ._timeout_task .cancel ()
379379
380- self .__timeout_expiry = time .monotonic () + self .timeout
381- self .__timeout_task = loop .create_task (self .__timeout_task_impl ())
380+ self ._timeout_expiry = time .monotonic () + self .timeout
381+ self ._timeout_task = loop .create_task (self ._timeout_task_impl ())
382382
383383 def _dispatch_timeout (self ):
384- if self .__stopped .done ():
384+ if self ._stopped .done ():
385385 return
386386
387- self .__stopped .set_result (True )
387+ self ._stopped .set_result (True )
388388 asyncio .create_task (
389389 self .on_timeout (), name = f"discord-ui-view-timeout-{ self .id } "
390390 )
391391
392392 def _dispatch_item (self , item : Item [V ], interaction : Interaction ):
393- if self .__stopped .done ():
393+ if self ._stopped .done ():
394394 return
395395
396396 if interaction .message :
@@ -403,14 +403,14 @@ def _dispatch_item(self, item: Item[V], interaction: Interaction):
403403
404404 def is_finished (self ) -> bool :
405405 """Whether the view has finished interacting."""
406- return self .__stopped .done ()
406+ return self ._stopped .done ()
407407
408408 def is_dispatchable (self ) -> bool :
409409 return any (item .is_dispatchable () for item in self .children )
410410
411411 def is_dispatching (self ) -> bool :
412412 """Whether the view has been added for dispatching purposes."""
413- return self .__cancel_callback is not None
413+ return self ._cancel_callback is not None
414414
415415 def is_persistent (self ) -> bool :
416416 """Whether the view is set up as persistent.
@@ -427,17 +427,17 @@ def stop(self) -> None:
427427
428428 This operation cannot be undone.
429429 """
430- if not self .__stopped .done ():
431- self .__stopped .set_result (False )
430+ if not self ._stopped .done ():
431+ self ._stopped .set_result (False )
432432
433- self .__timeout_expiry = None
434- if self .__timeout_task is not None :
435- self .__timeout_task .cancel ()
436- self .__timeout_task = None
433+ self ._timeout_expiry = None
434+ if self ._timeout_task is not None :
435+ self ._timeout_task .cancel ()
436+ self ._timeout_task = None
437437
438- if self .__cancel_callback :
439- self .__cancel_callback (self )
440- self .__cancel_callback = None
438+ if self ._cancel_callback :
439+ self ._cancel_callback (self )
440+ self ._cancel_callback = None
441441
442442 async def wait (self ) -> bool :
443443 """Waits until the view has finished interacting.
@@ -451,7 +451,7 @@ async def wait(self) -> bool:
451451 If ``True``, then the view timed out. If ``False`` then
452452 the view finished normally.
453453 """
454- return await self .__stopped
454+ return await self ._stopped
455455
456456 def disable_all_items (self , * , exclusions : list [Item [V ]] | None = None ) -> Self :
457457 """
0 commit comments