improve name formatting

This commit is contained in:
Tomáš Mládek 2019-10-16 10:29:45 +02:00
parent fd19140379
commit 59d11fcb82

View file

@ -12,7 +12,7 @@ from telegram.ext import Updater, CommandHandler, PicklePersistence
class DudleBot:
LINE_LIMIT = 9
LINE_LIMIT = 8
def __init__(self, token):
self.logger = logging.getLogger("dudle")
@ -139,8 +139,8 @@ class DudleBot:
for response in responses:
formatted_plan += f"{str(response)} "
formatted_plan += entry.name if len(entry.name) < self.LINE_LIMIT \
else entry.name[:self.LINE_LIMIT - 2] + ""
formatted_plan += entry.name if len(entry.name) <= self.LINE_LIMIT \
else entry.name[:self.LINE_LIMIT - 1].strip() + ""
formatted_plan += "\n"
formatted_plan += "```"