mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-21 20:47:44 +00:00
18 lines
526 B
Python
18 lines
526 B
Python
from aioredis.client import Redis
|
|
from discord.ext import commands
|
|
from discord.ext.commands.errors import CommandInvokeError
|
|
from lavalink.models import DefaultPlayer
|
|
|
|
|
|
class CustomContext(commands.Context):
|
|
@property
|
|
def redis(self) -> Redis:
|
|
return self.bot._redis_client
|
|
|
|
@property
|
|
def player(self) -> DefaultPlayer:
|
|
if hasattr(self.bot, "lavalink"):
|
|
return self.bot.lavalink.player_manager.get(self.guild.id)
|
|
|
|
raise CommandInvokeError("Lavalink is still starting up.")
|