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.type()
server = ctx.message.server
if server.id not in os.listdir(self.sound_base):
os.makedirs(os.path.join(self.sound_base, server.id))
if server.id not in self.settings:
self.settings[server.id] = {}
dataIO.save_json(self.settings_path, self.settings)
strbuffer = self.list_sounds(server.id)
if len(strbuffer) == 0:
await self.bot.reply(cf.warning(
"No sounds found. Use `{}addsound` to add one.".format(
ctx.prefix)))
return
mess = "```"
for line in strbuffer:
if len(mess) + len(line) + 4 < 2000:
mess += "\n" + line
else:
mess += "```"
await self.bot.whisper(mess)
mess = "```" + line
if mess != "":
mess += "```"
await self.bot.whisper(mess)