'Program not working as expected on DigitalOcean Ubuntu
Currently, I am writing a discord bot on python and tried to put it on my droplet of Digital Ocean to make it run 24/7; however, my play method and radio method will not produce sound in the environment. When I tested on my local python interpreter everything works fine but the statement seems to have no effect when it was run on the server.
@commands.command(name="radio")
async def radio(self, ctx, url: str = 'https://listen.moe/fallback'):
print("radio received!")
channel = ctx.message.author.voice.channel
self.is_radio = True
try:
self.vc = await channel.connect()
except Exception:
pass
if self.vc is None:
await ctx.send("Sorry but I cannot find where are you...")
else:
await ctx.send("Take a look at this! Hope you will like it~")
self.vc.play(FFmpegPCMAudio('https://listen.moe/fallback'))
I uses the ubuntu provided by the Digital Ocean droplet, and uses git clone to copy the file into the server, then uses python3 main.py to run the code.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
