mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-22 00:17:50 +00:00
Migrated settings cog
This commit is contained in:
+5
-2
@@ -6,6 +6,7 @@ from discord.ext import commands
|
||||
from discord.ext.commands.errors import CommandInvokeError
|
||||
from lavalink.models import DefaultPlayer
|
||||
|
||||
from tunebot.context import ContextLike
|
||||
from tunebot.redis import RedisAutoJoin
|
||||
from tunebot.redis import RedisPlaylistSource
|
||||
|
||||
@@ -43,11 +44,13 @@ class CustomContext(commands.Context):
|
||||
@property
|
||||
def playlist_source(self) -> "PlaylistSource":
|
||||
if not hasattr(self, "_playlist_source"):
|
||||
self._playlist_source = RedisPlaylistSource(self)
|
||||
ctx = ContextLike.from_discord_context(self)
|
||||
self._playlist_source = self.bot.playlist_source_context(ctx)
|
||||
return self._playlist_source
|
||||
|
||||
@property
|
||||
def autojoin(self) -> "AutoJoin":
|
||||
if not hasattr(self, "_autojoin"):
|
||||
self._autojoin = RedisAutoJoin(self)
|
||||
ctx = ContextLike.from_discord_context(self)
|
||||
self._autojoin = self.bot.autojoin_context(ctx)
|
||||
return self._autojoin
|
||||
|
||||
Reference in New Issue
Block a user