【发布时间】:2021-02-13 06:41:25
【问题描述】:
因此制作了一个简单的不和谐机器人,为用户提供横幅命令 ' @commands.Cog.listener() async def on_ready(self): print('Dictbot 运行流畅')
@commands.command()
async def banner(self, ctx, *, msg):
ascii_banner = self.cus_fig.renderText(msg)
discord_banner = ''
for charecter in ascii_banner:
discord_banner += charecter
if (charecter == ' '):
discord_banner += ' '
print(ascii_banner)
await ctx.send(discord_banner)
@commands.command()
async def font(self, ctx, *, fontName):
self.cus_fig = Figlet(font=fontName)
我使用了 pyfiglet,当我将艺术打印到终端时才可以找到它,但不和谐的是,并非所有字符的宽度都相同,所以它看起来超级难看。我做了一个临时修复,将所有单个空格变成 3 个空格,这可以正常工作,但字母略有偏差。而且我只能使用只有磅和空格的banner3字体。他们有什么方法可以使所有角色的距离不和谐吗?或者更好的方式来做我正在做的事情
【问题讨论】: