mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 19:28:54 -05:00
Support for over 2k characters in CCs list
This commit is contained in:
parent
15fc9db1c6
commit
cab5b23b0b
@ -95,11 +95,18 @@ class CustomCommands:
|
||||
if server.id in self.c_commands:
|
||||
cmdlist = self.c_commands[server.id]
|
||||
if cmdlist:
|
||||
msg = "```Custom commands:\n"
|
||||
i = 0
|
||||
msg = ["```Custom commands:\n"]
|
||||
for cmd in sorted([cmd for cmd in cmdlist.keys()]):
|
||||
msg += " {}{}\n".format(ctx.prefix, cmd)
|
||||
fmsg = msg + "```"
|
||||
await self.bot.whisper(fmsg)
|
||||
if len(msg[i]) + len(ctx.prefix) + len(cmd) + 5 > 2000:
|
||||
msg[i] += "```"
|
||||
i += 1
|
||||
msg.append("``` {}{}\n".format(ctx.prefix, cmd))
|
||||
else:
|
||||
msg[i] += " {}{}\n".format(ctx.prefix, cmd)
|
||||
msg[i] += "```"
|
||||
for cmds in msg:
|
||||
await self.bot.whisper(cmds)
|
||||
else:
|
||||
await self.bot.say("There are no custom commands in this server. Use addcom [command] [text]")
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user