mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 16:48:58 +00:00
Compare commits
4 commits
1c67016fa6
...
63c51ba6b2
Author | SHA1 | Date | |
---|---|---|---|
63c51ba6b2 | |||
5d8aa010fa | |||
6db6f12687 | |||
cbb90e8704 |
3 changed files with 5 additions and 3 deletions
|
@ -81,7 +81,8 @@ def bot_accounts_add(mysql, cfg):
|
|||
username = client.account_verify_credentials()['username']
|
||||
if username != session['username']:
|
||||
error = "Please authenticate as {}.".format(session['username'])
|
||||
print("Auth error - {} is not {}".format(session['username'], username))
|
||||
if username.lower() == session['username'].lower():
|
||||
error += " Make sure you capitalised the name properly - @user and @USER are different."
|
||||
return render_template("bot/accounts_add.html", error = error)
|
||||
except:
|
||||
session['step'] = 1
|
||||
|
|
|
@ -12,10 +12,11 @@
|
|||
</div>
|
||||
|
||||
{%include 'error.html' %}
|
||||
|
||||
|
||||
<div class="container centred">
|
||||
<form method="POST">
|
||||
{% 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>
|
||||
<input type="text" name="account" class="full-width" placeholder="@user@example.com">
|
||||
<br>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<div class="panel-text">
|
||||
{% 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-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 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>
|
||||
<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>
|
||||
|
|
Loading…
Reference in a new issue