Answer the question
In order to leave comments, you need to log in
How to interact with mp3 files through code? (python)?
I'm writing a discord bot, and I want to add the function of playing a record and rewinding/restarting it, etc., but I don't quite understand how to interact with an mp3 file. Here is my current code:
@bot.command(name = 'restart', help = 'Команда заново проигрывает видео')
async def restart(ctx):
voice = discord.utils.get(bot.voice_clients, guild=server)
sound = open('sound.mp3')
if voice.is_playing:
sound.seek(0)
await ctx.channel.send('Запись перезапущена')
else:
await ctx.channel.send('Сейчас ничего не воспроизводится')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question