mirror of
https://github.com/TotalFreedomMC/TotalFreedomBot.git
synced 2024-12-22 15:44:57 +00:00
Update functions.py
This commit is contained in:
parent
96e42c5f02
commit
d320148612
1 changed files with 2 additions and 12 deletions
14
functions.py
14
functions.py
|
@ -5,20 +5,10 @@ import requests
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from checks import *
|
from checks import *
|
||||||
|
|
||||||
#some functions taken from the old bot
|
|
||||||
def format_list_entry(embed, list, name):
|
def format_list_entry(embed, list, name):
|
||||||
embed.add_field(name="{} ({})".format(name, len(list)), value=", ".join(list), inline=False)
|
embed.add_field(name="{} ({})".format(name, len(list)), value=", ".join(list), inline=False)
|
||||||
return embed
|
return embed
|
||||||
|
|
||||||
def get_avatar(user, animate=True):
|
|
||||||
if user.avatar_url:
|
|
||||||
avatar = str(user.avatar_url).replace(".webp", ".png")
|
|
||||||
else:
|
|
||||||
avatar = str(user.default_avatar_url)
|
|
||||||
if not animate:
|
|
||||||
avatar = avatar.replace(".gif", ".png")
|
|
||||||
return avatar
|
|
||||||
|
|
||||||
def did_mention_other_user(users, author):
|
def did_mention_other_user(users, author):
|
||||||
for user in users:
|
for user in users:
|
||||||
if user is not author:
|
if user is not author:
|
||||||
|
@ -59,7 +49,7 @@ def write_json(file_name, data):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def hit_endpoint(command):
|
def hit_endpoint(command):
|
||||||
url = [CENOSRED_URL]
|
url = [CENSORED_URL]
|
||||||
payload = {}
|
payload = {}
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue