mirror of
https://github.com/deadcxap/YandexMusicDiscordBot.git
synced 2026-01-10 02:31:44 +03:00
fix: Add defer to some buttons.
This commit is contained in:
@@ -907,10 +907,6 @@ class VoiceExtension(BaseBot):
|
|||||||
if guild['current_menu']:
|
if guild['current_menu']:
|
||||||
await self.update_menu_embed_and_view(ctx, button_callback=button_callback)
|
await self.update_menu_embed_and_view(ctx, button_callback=button_callback)
|
||||||
|
|
||||||
if not guild['vibing']:
|
|
||||||
# Giving FFMPEG enough time to process the audio file
|
|
||||||
await asyncio.sleep(1)
|
|
||||||
|
|
||||||
loop = self.get_current_event_loop(ctx)
|
loop = self.get_current_event_loop(ctx)
|
||||||
try:
|
try:
|
||||||
vc.play(song, after=lambda exc: asyncio.run_coroutine_threadsafe(self.play_next_track(ctx, after=True), loop))
|
vc.play(song, after=lambda exc: asyncio.run_coroutine_threadsafe(self.play_next_track(ctx, after=True), loop))
|
||||||
|
|||||||
@@ -194,6 +194,8 @@ class SwitchTrackButton(Button, VoiceExtension):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
await interaction.response.defer()
|
||||||
|
|
||||||
if callback_type == 'next':
|
if callback_type == 'next':
|
||||||
title = await self.play_next_track(interaction, button_callback=True)
|
title = await self.play_next_track(interaction, button_callback=True)
|
||||||
else:
|
else:
|
||||||
@@ -381,6 +383,8 @@ class MyVibeButton(Button, VoiceExtension):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
await interaction.response.defer()
|
||||||
|
|
||||||
if track:
|
if track:
|
||||||
logging.info(f"[MENU] Playing vibe for track '{track["id"]}'")
|
logging.info(f"[MENU] Playing vibe for track '{track["id"]}'")
|
||||||
|
|||||||
Reference in New Issue
Block a user