mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-06-16 19:35:24 +02:00
Renamed webhook icon to guest icon for preperation of avatars in the client
This commit is contained in:
@ -37,7 +37,7 @@ def cosmetics_post():
|
||||
abort(400)
|
||||
css = request.form.get("css", None)
|
||||
css_limit = int(request.form.get("css_limit", 0))
|
||||
webhook_icon = request.form.get("webhook_icon", None)
|
||||
guest_icon = request.form.get("guest_icon", None)
|
||||
entry = db.session.query(Cosmetics).filter(Cosmetics.user_id == user_id).first()
|
||||
if entry:
|
||||
abort(409)
|
||||
@ -47,9 +47,9 @@ def cosmetics_post():
|
||||
user.css = css
|
||||
if css_limit is not None:
|
||||
user.css_limit = css_limit
|
||||
if webhook_icon is not None:
|
||||
webhook_icon = webhook_icon.lower() == "true"
|
||||
user.webhook_icon = webhook_icon
|
||||
if guest_icon is not None:
|
||||
guest_icon = guest_icon.lower() == "true"
|
||||
user.guest_icon = guest_icon
|
||||
db.session.add(user)
|
||||
db.session.commit()
|
||||
return ('', 204)
|
||||
@ -75,7 +75,7 @@ def cosmetics_patch():
|
||||
abort(400)
|
||||
css = request.form.get("css", None)
|
||||
css_limit = request.form.get("css_limit", None)
|
||||
webhook_icon = request.form.get("webhook_icon", None)
|
||||
guest_icon = request.form.get("guest_icon", None)
|
||||
entry = db.session.query(Cosmetics).filter(Cosmetics.user_id == user_id).first()
|
||||
if not entry:
|
||||
abort(409)
|
||||
@ -84,9 +84,9 @@ def cosmetics_patch():
|
||||
entry.css = css
|
||||
if css_limit is not None:
|
||||
entry.css_limit = css_limit
|
||||
if webhook_icon:
|
||||
webhook_icon = webhook_icon.lower() == "true"
|
||||
entry.webhook_icon = webhook_icon
|
||||
if guest_icon:
|
||||
guest_icon = guest_icon.lower() == "true"
|
||||
entry.guest_icon = guest_icon
|
||||
db.session.commit()
|
||||
return ('', 204)
|
||||
def prepare_guild_members_list(members, bans):
|
||||
@ -156,7 +156,7 @@ def administrate_guild(guild_id):
|
||||
"mentions_limit": db_guild.mentions_limit,
|
||||
"icon": db_guild.icon,
|
||||
"discordio": db_guild.discordio if db_guild.discordio != None else "",
|
||||
"webhook_icon": db_guild.webhook_icon if db_guild.webhook_icon != None else "",
|
||||
"guest_icon": db_guild.guest_icon if db_guild.guest_icon != None else "",
|
||||
}
|
||||
return render_template("administrate_guild.html.j2", guild=dbguild_dict, members=users, permissions=permissions, cosmetics=cosmetics)
|
||||
|
||||
@ -174,10 +174,10 @@ def update_administrate_guild(guild_id):
|
||||
if discordio != None and discordio.strip() == "":
|
||||
discordio = None
|
||||
db_guild.discordio = discordio
|
||||
webhook_icon = request.form.get("webhook_icon", db_guild.webhook_icon)
|
||||
if webhook_icon != None and webhook_icon.strip() == "":
|
||||
webhook_icon = None
|
||||
db_guild.webhook_icon = webhook_icon
|
||||
guest_icon = request.form.get("guest_icon", db_guild.guest_icon)
|
||||
if guest_icon != None and guest_icon.strip() == "":
|
||||
guest_icon = None
|
||||
db_guild.guest_icon = guest_icon
|
||||
db.session.commit()
|
||||
return jsonify(
|
||||
id=db_guild.id,
|
||||
@ -189,7 +189,7 @@ def update_administrate_guild(guild_id):
|
||||
bracket_links=db_guild.bracket_links,
|
||||
mentions_limit=db_guild.mentions_limit,
|
||||
discordio=db_guild.discordio,
|
||||
webhook_icon=db_guild.webhook_icon,
|
||||
guest_icon=db_guild.guest_icon,
|
||||
)
|
||||
|
||||
@admin.route("/guilds")
|
||||
|
@ -251,7 +251,7 @@ def post():
|
||||
avatar = url_for('static', filename='img/titanembeds_square.png', _external=True)
|
||||
dbguild = db.session.query(Guilds).filter(Guilds.guild_id == guild_id).first()
|
||||
if dbguild:
|
||||
icon = dbguild.webhook_icon
|
||||
icon = dbguild.guest_icon
|
||||
if icon:
|
||||
avatar = icon
|
||||
else:
|
||||
|
@ -210,7 +210,7 @@ def administrate_guild(guild_id):
|
||||
"mentions_limit": db_guild.mentions_limit,
|
||||
"icon": db_guild.icon,
|
||||
"discordio": db_guild.discordio if db_guild.discordio != None else "",
|
||||
"webhook_icon": db_guild.webhook_icon if db_guild.webhook_icon != None else "",
|
||||
"guest_icon": db_guild.guest_icon if db_guild.guest_icon != None else "",
|
||||
}
|
||||
return render_template("administrate_guild.html.j2", guild=dbguild_dict, members=users, permissions=permissions, cosmetics=cosmetics)
|
||||
|
||||
@ -236,10 +236,10 @@ def update_administrate_guild(guild_id):
|
||||
discordio = None
|
||||
db_guild.discordio = discordio
|
||||
|
||||
webhook_icon = request.form.get("webhook_icon", db_guild.webhook_icon)
|
||||
if webhook_icon != None and webhook_icon.strip() == "":
|
||||
webhook_icon = None
|
||||
db_guild.webhook_icon = webhook_icon
|
||||
guest_icon = request.form.get("guest_icon", db_guild.guest_icon)
|
||||
if guest_icon != None and guest_icon.strip() == "":
|
||||
guest_icon = None
|
||||
db_guild.guest_icon = guest_icon
|
||||
|
||||
db.session.commit()
|
||||
return jsonify(
|
||||
@ -252,7 +252,7 @@ def update_administrate_guild(guild_id):
|
||||
bracket_links=db_guild.bracket_links,
|
||||
mentions_limit=db_guild.mentions_limit,
|
||||
discordio=db_guild.discordio,
|
||||
webhook_icon=webhook_icon,
|
||||
guest_icon=guest_icon,
|
||||
)
|
||||
|
||||
@user.route("/add-bot/<guild_id>")
|
||||
@ -444,9 +444,9 @@ def donate_patch():
|
||||
entry = db.session.query(Cosmetics).filter(Cosmetics.user_id == session["user_id"]).first()
|
||||
if item == "custom_css_slots":
|
||||
subtract_amt = 100
|
||||
if item == "webhook_icon":
|
||||
if item == "guest_icon":
|
||||
subtract_amt = 300
|
||||
if entry is not None and entry.webhook_icon:
|
||||
if entry is not None and entry.guest_icon:
|
||||
abort(400)
|
||||
amt_change = -1 * subtract_amt * amount
|
||||
subtract = set_titan_token(session["user_id"], amt_change, "BUY " + item + " x" + str(amount))
|
||||
@ -459,10 +459,10 @@ def donate_patch():
|
||||
entry.css = True
|
||||
entry.css_limit = 0
|
||||
entry.css_limit += amount
|
||||
if item == "webhook_icon":
|
||||
if item == "guest_icon":
|
||||
if not entry:
|
||||
entry = Cosmetics(session["user_id"])
|
||||
entry.webhook_icon = True
|
||||
entry.guest_icon = True
|
||||
db.session.add(entry)
|
||||
db.session.commit()
|
||||
return ('', 204)
|
Reference in New Issue
Block a user