From c45f68999e3b70f6257ed89bf5555589434dd1bb Mon Sep 17 00:00:00 2001 From: Elmon11 Date: Fri, 18 Dec 2020 18:01:49 +0100 Subject: [PATCH] Update functions.py --- functions.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/functions.py b/functions.py index 50013f9..61b1c98 100644 --- a/functions.py +++ b/functions.py @@ -4,10 +4,21 @@ import requests from checks import * +class embed_entry: + def __init__(self, name, value, *, playercount): + self.name = name + self.value = value + if playercount: + self.playercount = playercount + def format_list_entry(embed, l, name): - embed.add_field(name="{} ({})".format(name, len(l)), - value=", ".join(l), inline=False) - return embed + l_names = [] + [l_names.append(f'`{l[i]}`') for i in range(len(l))] + em = embed_entry(name=name, + value=", ".join(l_names), + playercount = len(l) + ) + return em def did_mention_other_user(users, author):