1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-26 00:58:59 +00:00

Compare commits

..

No commits in common. "63c51ba6b2af43d52e0addf8e0803167d9e249be" and "1c67016fa6aba3cbfe8640a84cc0b642a0ee32a7" have entirely different histories.

3 changed files with 3 additions and 5 deletions

View file

@ -81,8 +81,7 @@ def bot_accounts_add(mysql, cfg):
username = client.account_verify_credentials()['username'] username = client.account_verify_credentials()['username']
if username != session['username']: if username != session['username']:
error = "Please authenticate as {}.".format(session['username']) error = "Please authenticate as {}.".format(session['username'])
if username.lower() == session['username'].lower(): print("Auth error - {} is not {}".format(session['username'], username))
error += " Make sure you capitalised the name properly - @user and @USER are different."
return render_template("bot/accounts_add.html", error = error) return render_template("bot/accounts_add.html", error = error)
except: except:
session['step'] = 1 session['step'] = 1

View file

@ -16,7 +16,6 @@
<div class="container centred"> <div class="container centred">
<form method="POST"> <form method="POST">
{% if session['step'] == 1 %} {% if session['step'] == 1 %}
<p>Please enter the full handle of the account you'd like your bot to learn from. Note that this is case sensitive.</p>
<label for="account" class="important">Account handle</label> <label for="account" class="important">Account handle</label>
<input type="text" name="account" class="full-width" placeholder="@user@example.com"> <input type="text" name="account" class="full-width" placeholder="@user@example.com">
<br> <br>

View file

@ -23,7 +23,7 @@
<div class="panel-text"> <div class="panel-text">
{% set handle_list = bot['handle'].split('@') %} {% set handle_list = bot['handle'].split('@') %}
<div class="panel-name">@{{ handle_list[1] }}<span class="subtle tiny">@{{ handle_list[2] }}</span></div> <div class="panel-name">@{{ handle_list[1] }}<span class="subtle tiny">@{{ handle_list[2] }}</span></div>
<div class="panel-status">{{ "Online" if bot['enabled'] else "Offline"}}, learning from {{ bot_users[bot['handle']] }} accounts.{% if bot['handle'] in next_posts %} Next post in {{ next_posts[bot['handle']][0] }} minute{% if next_posts[bot['handle']][0] != 1 %}s{% endif %}{% endif %}.</div> <div class="panel-status">{{ "Online" if bot['enabled'] else "Offline"}}, learning from {{ bot_users[bot['handle']] }} accounts.{% if bot['handle'] in next_posts %} Next post in {{ next_posts[bot['handle']][0] }} minutes.{% endif %}</div>
</div> </div>
<div class="panel-actions"> <div class="panel-actions">
<a class="button btn-secondary" href="/bot/toggle/{{ bot['handle'] }}" title="Turn on/off"><i class="fas fa-power-off"></i></a><a class="button btn-secondary" href="/bot/edit/{{ bot['handle'] }}" title="Configure"><i class="fas fa-cog"></i></a><a class="button btn-secondary" href="/bot/accounts/{{ bot['handle'] }}" title="Accounts learned from"><i class="fas fa-users"></i></a><a class="button btn-secondary" href="/bot/blacklist/{{ bot['handle'] }}" title="Banned words"><i class="fas fa-strikethrough"></i></a><a class="button btn-secondary" href="/bot/chat/{{ bot['handle'] }}" title="Chat"><i class="fas fa-comment"></i></a><a class="button btn-dangerous" href="/bot/delete/{{ bot['handle'] }}" title="Delete"><i class="fas fa-trash"></i></a> <a class="button btn-secondary" href="/bot/toggle/{{ bot['handle'] }}" title="Turn on/off"><i class="fas fa-power-off"></i></a><a class="button btn-secondary" href="/bot/edit/{{ bot['handle'] }}" title="Configure"><i class="fas fa-cog"></i></a><a class="button btn-secondary" href="/bot/accounts/{{ bot['handle'] }}" title="Accounts learned from"><i class="fas fa-users"></i></a><a class="button btn-secondary" href="/bot/blacklist/{{ bot['handle'] }}" title="Banned words"><i class="fas fa-strikethrough"></i></a><a class="button btn-secondary" href="/bot/chat/{{ bot['handle'] }}" title="Chat"><i class="fas fa-comment"></i></a><a class="button btn-dangerous" href="/bot/delete/{{ bot['handle'] }}" title="Delete"><i class="fas fa-trash"></i></a>