Procházet zdrojové kódy

fixing the printsettings command being too big to send because of custom commands. Added a debug mode for cc list to compensate.

tags/v1.1.1
roxie před 6 roky
rodič
revize
62c6c31851
2 změnil soubory, kde provedl 15 přidání a 5 odebrání
  1. +8
    -1
      cogs/customcommands.py
  2. +7
    -4
      cogs/settings.py

+ 8
- 1
cogs/customcommands.py Zobrazit soubor

@@ -95,15 +95,22 @@ class CustomCommands():


@custom.command(pass_context=True)
async def list(self, ctx):
async def list(self, ctx, debug="0"):
"Lists all custom commands for this server."
if debug != "0" and debug != "1":
debug = "0"
self.servers = self.con.load_config()
l = self.servers[ctx.message.server.id]["custom_commands"]
listzero = ""
listone = ""

for command in l["0"]:
if debug == "1":
command += command + " - {}".format(l["0"][command])
listzero = listzero + "- " + command + "\n"
for command in l["1"]:
if debug == "1":
command += command + " - {}".format(l["1"][command])
listone = listone + "- " + command + "\n"
if not listone:
listone = "There are no commands setup.\n"

+ 7
- 4
cogs/settings.py Zobrazit soubor

@@ -99,10 +99,13 @@ class Settings():
em.set_author(name="{} settings for {}.".format(self.bot.user.name, ctx.message.server.name), icon_url=self.bot.user.avatar_url)

for settings in config:
settingcontent = ""
for x in config[settings].items():
settingcontent += str(x).strip("()") + "\n"
em.add_field(name=settings, value=settingcontent, inline=False)
if settings != "custom_commands":
settingcontent = ""
for x in config[settings].items():
settingcontent += str(x).strip("()") + "\n"
em.add_field(name=settings, value=settingcontent, inline=False)
else:
em.add_field(name="custom_commands", value="For Custom Commands, use the custom list command.", inline=False)

return await self.bot.say(embed=em)


Načítá se…
Zrušit
Uložit