@bot.event
async def on_ready():
import discord
from discord.ext import commands
import os
channel = bot.get_channel(1071475940468731984)
channel.play(discord.FFmpegPCMAudio('test.mp3'))
await channel.connect()
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='!')
@bot.command()
async def play(ctx):
voice_channel = ctx.author.voice.channel
voice_client = await voice_channel.connect()
audio_source = discord.FFmpegPCMAudio('test.mp3')
voice_client.play(audio_source)