Chat username discord colors!

This commit is contained in:
Jeremy Zhang
2017-09-15 06:25:03 +00:00
parent 286f395b72
commit 80d89b49f8
3 changed files with 122 additions and 9 deletions

View File

@ -241,9 +241,8 @@ def post():
userid = session["user_id"]
content = format_everyone_mention(chan, content)
webhook = get_channel_webhook_url(guild_id, channel_id)
if userid in get_administrators_list():
oldcontent = content
content = "(Titan Dev) " + oldcontent
# if userid in get_administrators_list():
# content = "(Titan Dev) " + content
if webhook:
if (session['unauthenticated']):
username = session["username"] + "#" + str(session["user_id"])
@ -258,11 +257,10 @@ def post():
if dbUser:
if dbUser.nickname:
username = dbUser.nickname
if content.startswith("(Titan Dev) "):
content = content[12:]
username = "(Titan Dev) " + username
else:
username = username + "#" + str(session['discriminator'])
# if content.startswith("(Titan Dev) "):
# content = content[12:]
# username = "(Titan Dev) " + username
username = username + "#" + str(session['discriminator'])
avatar = session['avatar']
message = discord_api.execute_webhook(webhook.get("id"), webhook.get("token"), username, avatar, content)
else: