mirror of
https://github.com/deadcxap/YandexMusicDiscordBot.git
synced 2026-01-09 23:51:45 +03:00
fix: Increase timeout on update.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from time import monotonic
|
||||
from typing import Self, Literal, cast
|
||||
|
||||
from discord.ui import View, Button, Item, Select
|
||||
@@ -728,6 +729,9 @@ class MenuView(View, VoiceExtension):
|
||||
if disable:
|
||||
self.disable_all_items()
|
||||
|
||||
if self.timeout:
|
||||
self.__timeout_expiry = monotonic() + self.timeout
|
||||
|
||||
return self
|
||||
|
||||
async def on_timeout(self) -> None:
|
||||
|
||||
@@ -2,7 +2,7 @@ from math import ceil
|
||||
from typing import Any
|
||||
|
||||
from discord.ui import View, Button, Item
|
||||
from discord import ApplicationContext, ButtonStyle, Interaction, Embed
|
||||
from discord import ApplicationContext, ButtonStyle, Interaction, Embed, HTTPException
|
||||
|
||||
from MusicBot.cogs.utils.voice_extension import VoiceExtension
|
||||
|
||||
@@ -88,4 +88,8 @@ class QueueView(View, VoiceExtension):
|
||||
self.prev_button.disabled = True
|
||||
|
||||
async def on_timeout(self) -> None:
|
||||
try:
|
||||
await super().on_timeout()
|
||||
except HTTPException:
|
||||
pass
|
||||
self.stop()
|
||||
Reference in New Issue
Block a user