mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-21 19:57:48 +00:00
Added sources functionality + pre-commit
This commit is contained in:
+18
@@ -1,8 +1,14 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from aioredis.client import Redis
|
||||
from discord import Embed
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands.errors import CommandInvokeError
|
||||
from lavalink.models import DefaultPlayer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from bot import TuneBot
|
||||
|
||||
|
||||
class CustomContext(commands.Context):
|
||||
@property
|
||||
@@ -15,3 +21,15 @@ class CustomContext(commands.Context):
|
||||
return self.bot.lavalink.player_manager.get(self.guild.id)
|
||||
|
||||
raise CommandInvokeError("Lavalink is still starting up.")
|
||||
|
||||
def create_embed(self) -> Embed:
|
||||
bot: TuneBot = self.bot
|
||||
color = bot.colors["embed"]
|
||||
|
||||
avatar = None
|
||||
if avatar_asset := self.author.avatar:
|
||||
avatar = avatar_asset.with_static_format("jpeg")
|
||||
|
||||
embed = Embed(color=color)
|
||||
embed.set_footer(text=f"Requested by: {self.author}", icon_url=avatar)
|
||||
return embed
|
||||
|
||||
Reference in New Issue
Block a user