Update functions.py

This commit is contained in:
Elmon11 2020-12-18 18:01:49 +01:00 committed by GitHub
parent c754a2b132
commit c45f68999e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,10 +4,21 @@ import requests
from checks import * 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): def format_list_entry(embed, l, name):
embed.add_field(name="{} ({})".format(name, len(l)), l_names = []
value=", ".join(l), inline=False) [l_names.append(f'`{l[i]}`') for i in range(len(l))]
return embed em = embed_entry(name=name,
value=", ".join(l_names),
playercount = len(l)
)
return em
def did_mention_other_user(users, author): def did_mention_other_user(users, author):