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
1 changed files with 14 additions and 3 deletions

View File

@ -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):