[Python] VoiceClient.play() missing 1 required positional argument: 'source' error when trying...

Discussão em 'Python' iniciado por Stack, Fevereiro 8, 2025.

  1. Stack

    Stack Membro Participativo

    I am using discord.py with the default app_commands

    from discord import Intents, Client, Message, app_commands
    from discord.voice_client import VoiceClient


    @tree.command(
    name="play",
    description="insert a youtube url for music",
    guild = discord.Object(id=806555220468432906)
    )
    async def play_command(command) -> None:
    source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio("Music.m4a"))
    VoiceClient.play(source)`


    This code produces the error: TypeError: VoiceClient.play() missing 1 required positional argument: 'source'

    I've tried changing the encoding of FFmpeg while still getting the same error. help

    Continue reading...

Compartilhe esta Página