mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -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:
|
if server.id in self.c_commands:
|
||||||
cmdlist = self.c_commands[server.id]
|
cmdlist = self.c_commands[server.id]
|
||||||
if cmdlist:
|
if cmdlist:
|
||||||
msg = "```Custom commands:\n"
|
i = 0
|
||||||
|
msg = ["```Custom commands:\n"]
|
||||||
for cmd in sorted([cmd for cmd in cmdlist.keys()]):
|
for cmd in sorted([cmd for cmd in cmdlist.keys()]):
|
||||||
msg += " {}{}\n".format(ctx.prefix, cmd)
|
if len(msg[i]) + len(ctx.prefix) + len(cmd) + 5 > 2000:
|
||||||
fmsg = msg + "```"
|
msg[i] += "```"
|
||||||
await self.bot.whisper(fmsg)
|
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:
|
else:
|
||||||
await self.bot.say("There are no custom commands in this server. Use addcom [command] [text]")
|
await self.bot.say("There are no custom commands in this server. Use addcom [command] [text]")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user