mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-21 19:07:52 +00:00
16 lines
506 B
Python
16 lines
506 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):
|
|
def get_redis(self) -> Redis:
|
|
return self.bot._redis_client
|
|
|
|
def get_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.")
|