Amber/commands.py

21 lines
828 B
Python
Raw Normal View History

2025-01-18 21:45:25 -05:00
import discord
from discord import app_commands
from audio import join_voice, leave_voice, play_audio
async def setup_commands(client):
@client.tree.command(name="join", description="Amber joins the voice channel you're in.")
async def join(interaction: discord.Interaction):
await join_voice(interaction)
@client.tree.command(name="leave", description="Amber leaves the current voice channel.")
async def leave(interaction: discord.Interaction):
await leave_voice(interaction)
@client.tree.command(name="play", description="Search and play a song by name or YouTube URL.")
@app_commands.describe(query="The name or YouTube URL of the song.")
async def play(interaction: discord.Interaction, query: str):
await play_audio(interaction, query)
await client.tree.sync()