0
votes

I am making a Disord bot based on a python code. The python code is executing perfectly. But when the discord bot calls the program it screws up the formatting/alignment of the output.

I am using tabulate on python for the output. Thankful for any help you can do to sort this out.

Here is the code for tabulate that calls the list for output

topgn=(tabulate(alist, headers='keys',tablefmt='pipe',numalign='left',stralign='center'))

Also attaching the screenshots python output ss - discord bot ss

Thanks a ton

1
Unless you send it in a codeblock you won't be able to send it well formattedŁukasz Kwieciński

1 Answers

0
votes

Use monospace font. Discord has codeblocks for this, which need 3 backticks. So your code would be:

topgn = "```" + tabulate(alist, headers='keys',tablefmt='pipe',numalign='left',stralign='center') + "```"