Skip to content

Commit e83edf1

Browse files
authored
feat: Add music system (#2)
1 parent 5554284 commit e83edf1

5 files changed

Lines changed: 501 additions & 1 deletion

File tree

bot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
from store.claimtime import ClaimtimeDBStore
4242
from errors import ModuleDisabled
43+
import wavelink
4344

4445
MISSING: Any = discord.utils.MISSING
4546
PREMIUM_SKU_ID: Final[int] = 1256218013930094682
@@ -204,6 +205,7 @@ def __init__(
204205
self.claimtime_store: ClaimtimeDBStore = ClaimtimeDBStore(self)
205206
self._disabled_modules: dict[int, list[str]] = {}
206207
self.__wh_url: str | None = debug_webhook_url
208+
self.wavelink_node_pool: wavelink.Pool = wavelink.Pool()
207209

208210
self.add_check(self.module_enabled)
209211

@@ -600,3 +602,8 @@ async def on_ready(self) -> None:
600602
colour=discord.Colour.blue(),
601603
),
602604
)
605+
606+
async def close(self) -> None:
607+
await self.pool.close()
608+
await self.wavelink_node_pool.close()
609+
await super().close()

cogs/lyrics_generator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ async def callback(self, interaction: discord.Interaction['LegacyBot']) -> None:
359359
str(error),
360360
ephemeral=True,
361361
)
362+
return
363+
362364
view = LyricsGeneratorView(lyrics, interaction.client, interaction.user.id, song)
363365
await interaction.edit_original_response(
364366
view=view,

0 commit comments

Comments
 (0)