Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await self.bot.reply(
cf.error("A sound with that filename already exists."
" Please change the filename and try again."))
return
async with aiohttp.get(url) as new_sound:
f = open(filepath, "wb")
f.write(await new_sound.read())
f.close()
self.settings[server.id][
os.path.splitext(filename)[0]] = {"volume": default_volume}
dataIO.save_json(self.settings_path, self.settings)
await self.bot.reply(
cf.info("Sound {} added.".format(os.path.splitext(filename)[0])))