mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 02:16:09 -05:00
V3/start screen (#1038)
* Added new start screen * Added Bordered util Bordered function required for boxes in start screen * Update events.py Added Color to the Title Added Shard count * Update events.py Added Discord.py version Added package checking for docs and tests Added package checking for voice * Update chat_formatting.py Cleaned up the border function a bit.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import itertools
|
||||
|
||||
def error(text):
|
||||
return "\N{NO ENTRY SIGN} {}".format(text)
|
||||
|
||||
@@ -31,6 +33,23 @@ def italics(text):
|
||||
return "*{}*".format(text)
|
||||
|
||||
|
||||
def bordered(text1: list, text2: list):
|
||||
width1, width2 = max((len(s1) + 9, len(s2) + 9) for s1 in text1 for s2 in text2)
|
||||
res = ['┌{}┐{}┌{}┐'.format("─"*width1, " "*4, "─"*width2)]
|
||||
flag = True
|
||||
for x, y in itertools.zip_longest(text1, text2):
|
||||
if y:
|
||||
m = "│{}│{}│{}│".format((x + " " * width1)[:width1], " "*4, (y + " " * width2)[:width2])
|
||||
elif x and flag and not y:
|
||||
m = "│{}│{}└{}┘".format((x + " " * width1)[:width1], " "*4, "─" * width2)
|
||||
flag = False
|
||||
else:
|
||||
m = "│{}│".format((x + " " * width1)[:width1])
|
||||
res.append(m)
|
||||
res.append("└" + "─" * width1 + "┘")
|
||||
return "\n".join(res)
|
||||
|
||||
|
||||
def pagify(text, delims=["\n"], *, escape_mass_mentions=True, shorten_by=8,
|
||||
page_length=2000):
|
||||
"""DOES NOT RESPECT MARKDOWN BOXES OR INLINE CODE"""
|
||||
|
||||
Reference in New Issue
Block a user