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
|
import logging
|
||||||
|
from time import monotonic
|
||||||
from typing import Self, Literal, cast
|
from typing import Self, Literal, cast
|
||||||
|
|
||||||
from discord.ui import View, Button, Item, Select
|
from discord.ui import View, Button, Item, Select
|
||||||
@@ -727,6 +728,9 @@ class MenuView(View, VoiceExtension):
|
|||||||
|
|
||||||
if disable:
|
if disable:
|
||||||
self.disable_all_items()
|
self.disable_all_items()
|
||||||
|
|
||||||
|
if self.timeout:
|
||||||
|
self.__timeout_expiry = monotonic() + self.timeout
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from math import ceil
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from discord.ui import View, Button, Item
|
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
|
from MusicBot.cogs.utils.voice_extension import VoiceExtension
|
||||||
|
|
||||||
@@ -88,4 +88,8 @@ class QueueView(View, VoiceExtension):
|
|||||||
self.prev_button.disabled = True
|
self.prev_button.disabled = True
|
||||||
|
|
||||||
async def on_timeout(self) -> None:
|
async def on_timeout(self) -> None:
|
||||||
self.stop()
|
try:
|
||||||
|
await super().on_timeout()
|
||||||
|
except HTTPException:
|
||||||
|
pass
|
||||||
|
self.stop()
|
||||||
|
|||||||
Reference in New Issue
Block a user