using @property for existing context functions

This commit is contained in:
2021-11-06 17:56:17 +01:00
parent c3fc008f3a
commit 9b2babf4e3
3 changed files with 21 additions and 23 deletions
+4 -2
View File
@@ -5,10 +5,12 @@ from lavalink.models import DefaultPlayer
class CustomContext(commands.Context):
def get_redis(self) -> Redis:
@property
def redis(self) -> Redis:
return self.bot._redis_client
def get_player(self) -> DefaultPlayer:
@property
def player(self) -> DefaultPlayer:
if hasattr(self.bot, "lavalink"):
return self.bot.lavalink.player_manager.get(self.guild.id)