'Discord.py | Playing music without FFmpeg
So i am using replit as my IDE and FFmpeg isn't working so i tried replit's play.audio_file but it says that the source has to be within 2 secs. Is there anyway to fix this? Here is my code:
@client.command()
async def join(ctx, *, channelname=None):
if channelname is None:
try:
channel = ctx.author.voice.channel
voice = await channel.connect()
source = audio.play('24hourlofi.wav')
player = voice.play(source)
await ctx.send("Joined!")
except AttributeError:
await ctx.send("Error! You are not connected to the channel available to me.")
except Exception as e:
print(e)
else:
channel = discord.utils.get(
ctx.guild.channels, name=channelname, type=discord.ChannelType.voice)
try:
await channel.connect()
await ctx.send("Joined!")
except AttributeError:
await ctx.send("Error! Channel not found.")
except Exception as e:
print(e)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
