mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-21 22:57:48 +00:00
slash command descriptions configurable by config
This commit is contained in:
+8
-12
@@ -2,8 +2,6 @@ import asyncio
|
||||
import re
|
||||
from typing import Optional
|
||||
|
||||
from aioredis.client import Redis
|
||||
|
||||
import discord
|
||||
from discord.channel import TextChannel
|
||||
from discord.ext.commands.context import Context
|
||||
@@ -13,6 +11,7 @@ from lavalink.models import AudioTrack, DefaultPlayer
|
||||
|
||||
from bot import ChristmasBot
|
||||
from utils.EmbedGenerator import EmbedGenerator
|
||||
from utils.classes import BaseCog
|
||||
from utils.database import AutoJoin
|
||||
from context import CustomContext
|
||||
from discord import Embed
|
||||
@@ -69,10 +68,7 @@ class LavalinkVoiceClient(discord.VoiceClient):
|
||||
self.cleanup()
|
||||
|
||||
|
||||
class Music(commands.Cog):
|
||||
def __init__(self, bot: ChristmasBot):
|
||||
self.bot = bot
|
||||
|
||||
class Music(BaseCog):
|
||||
@commands.Cog.listener()
|
||||
async def on_ready(self):
|
||||
if not hasattr(
|
||||
@@ -96,7 +92,7 @@ class Music(commands.Cog):
|
||||
|
||||
for guild_id, (voicechannel_id, textchannel_id) in redis_result.items():
|
||||
player = self.bot.lavalink.player_manager.create(guild_id)
|
||||
player.store('channel', textchannel_id)
|
||||
player.store("channel", textchannel_id)
|
||||
voice_channel = await self.bot.fetch_channel(voicechannel_id)
|
||||
await voice_channel.connect(cls=LavalinkVoiceClient)
|
||||
if not player.is_playing:
|
||||
@@ -220,7 +216,7 @@ class Music(commands.Cog):
|
||||
|
||||
@commands.command(name="connect", aliases=["p", "play", "join"])
|
||||
async def play(self, ctx: CustomContext):
|
||||
"""Starts playing Christmas bangers"""
|
||||
"""Start the radio"""
|
||||
# Get the player for this guild from cache.
|
||||
player: DefaultPlayer = self.bot.lavalink.player_manager.get(ctx.guild.id)
|
||||
await self.fill_player_queue(player, self.bot.config["queue_buffer_size"])
|
||||
@@ -232,20 +228,20 @@ class Music(commands.Cog):
|
||||
|
||||
@commands.command(name="skip", aliases=["next"])
|
||||
async def skip(self, ctx: Context):
|
||||
"""I heard this song way too often"""
|
||||
"""Skip the current song"""
|
||||
player: DefaultPlayer = self.bot.lavalink.player_manager.get(ctx.guild.id)
|
||||
await player.skip()
|
||||
await ctx.send("Skipped current song")
|
||||
|
||||
@commands.command(name="queue")
|
||||
@commands.command(name="queue", aliases=["q"])
|
||||
async def queue(self, ctx: Context):
|
||||
"""Ghetto queue"""
|
||||
"""Display the current radio queue"""
|
||||
player: DefaultPlayer = self.bot.lavalink.player_manager.get(ctx.guild.id)
|
||||
await EmbedGenerator.Message(ctx, "Queue:", player.queue)
|
||||
|
||||
@commands.command(name="disconnect", aliases=["dc", "stop"])
|
||||
async def disconnect(self, ctx: Context):
|
||||
"""Disconnects ChristmasBot"""
|
||||
"""Disconnects the radio from the channel"""
|
||||
player: DefaultPlayer = self.bot.lavalink.player_manager.get(ctx.guild.id)
|
||||
|
||||
if not player.is_connected:
|
||||
|
||||
Reference in New Issue
Block a user