Przeglądaj źródła

Reworded Kofi info on userpanel. Added reward name to mgmt reward queue

deadtom 2 tygodni temu
rodzic
commit
ed4466d1e7

+ 1 - 0
ownchatbot/__init__.py

@@ -45,6 +45,7 @@ def create_app(test_config=None):
 
     def announce():
         global current_index
+        app.config.from_pyfile('announce.py', silent=True)
         announcements = app.config['ANNOUNCEMENTS']
         message = announcements[current_index]
         send_system_chat(message)

+ 10 - 2
ownchatbot/templates/mgmt.html

@@ -121,6 +121,7 @@
                     <tr>
                         <th>Time</th>
                         <th>Reward</th>
+                        <th>Description</th>
                         <th>User</th>
                         <th></th>
                     </tr>
@@ -130,10 +131,11 @@
                     <tr>
                         <td>{{ row[1].replace(tzinfo=utc_timezone).astimezone().strftime("%H:%M") }}</td>
                         {% if row[4] %}
-                        <td><s>{{ rewards[row[2]]["info"] }}</s></td>
+                        <td><s>{{ row[2] }}</s></td>
                         {% else %}
-                        <td>{{ rewards[row[2]]["info"] }}</td>
+                        <td>{{ row[2] }}</td>
                         {% endif %}
+                        <td>{{ rewards[row[2]]["info"] }}</td>
                         <td>{{ row[6] }}</td>
                         {% if row[4] %}
                         {% if row[5] %}
@@ -165,6 +167,7 @@
                         <th>User</th>
                         <th>Points balance</th>
                         <th>Email</th>
+                        <th>Authed</th>
                         <th></th>
                     </tr>
                 </thead>
@@ -180,6 +183,11 @@
                         {% else %}
                             <td>none</td>
                         {% endif %}
+                        {% if user[3] %}
+                            <td>Yes</td>
+                        {% else %}
+                            <td>No</td>
+                        {% endif %}
                         <td> <a href="/mgmt/edit_account/{{ user[0] }}?name={{ user[1] }}&points={{ user[2] }}&email={{ user[4] }}"><button class="button button2" onclick="openTab(event, 'panel')">Edit</button></a> </td>
                     </tr>
                 {% endfor %}

+ 9 - 6
ownchatbot/templates/userpanel.html

@@ -25,6 +25,8 @@
             <li><u>Goals</u> are rewards that everyone in chat can contribute to. The streamer fulfills the reward when the goal is reached.</li>
             <li><u>Milestones</u> are smaller goals inside a goal, to celebrate and/or reward progress toward the larger goal.</li>
         </ul>
+        
+        <hr>
         <h4>Chat commands</h4>
         <ul>
             <li>{{ prefix }}help - Shows the help message.</li>
@@ -32,8 +34,9 @@
             <li>{{ prefix }}rewards - Shows you the list of active rewards.</li>
         </ul>
         
+        <hr>
         {% if kofi_integration %}
-            <h4>Kofi Integration</h4>
+            <h4>Kofi Integration <a href="{{ kofi_settings['kofi_url'] }}/donate" target="new"><img src="/static/img/kofi/{{ kofi_settings['kofi_logo'] }}"></a></h4>
             
             {% if kofi_settings['donations'] %}
                 {% set d_points_label = 'point' if donation_points == 1 else 'points' %}
@@ -42,7 +45,7 @@
             
             {% if kofi_settings['subs'] %}
                 {% set s_points_label = 'point' if sub_points == 1 else 'points' %}
-                Subscribers get {{ kofi_settings['sub_points'] }} {{ s_points_label }} every month.<br>
+                Kofi subscribers get {{ kofi_settings['sub_points'] }} {{ s_points_label }} every month.<br>
             {% endif %}
             <i>You must be authenticated with Owncast to take advantage of Kofi integration.</i><br>
             
@@ -50,7 +53,7 @@
             
             <div>
                 {% if user['user_authed'] %}
-                    <a href="{{ kofi_settings['kofi_url'] }}/donate" target="new"><img src="/static/img/kofi/{{ kofi_settings['kofi_logo'] }}"></a><br>
+                    <br>
                     OwnchatBot recognizes your Kofi account by your email address. In order for OwnchatBot to award your donation points, you must enter the email address associated with your Kofi account here.<br><br>
                     
                     {% with messages = get_flashed_messages(with_categories=true) %}
@@ -76,19 +79,19 @@
                         <br>Email addresses are <b>ONLY</b> used for Kofi integration. They are not sent to any other individual or company, and will not be used to create or send mailing lists of any kind.<br>
                         <input type="hidden" name="user_id" value="{{ user[0] }}"> <button class="button button2" type="submit">Save Email</button>
                     </form><br>
-                {% else %}
-                    <i>You must authenticate with Owncast to get Kofi rewards.</i><br>
                 {% endif %}
                 </div>
             {% endfor %}
         {% endif %}
 
+        <hr>
         <h4>Other stuff</h4>
         <div>
             OwnchatBot can be downloaded from <a href=https://git.deadtom.me/deadtom/OwnchatBot>https://git.deadtom.me/deadtom/OwnchatBot</a>.<br>
             If you are thrilled to death with OwnchatBot, and want to throw a little monetary love the developer's way, <a href=https://ko-fi.com/deadtom>he's on Kofi</a>.<br>
             OwnchatBot © 2025 by <a href=https://www.deadtom.me>DeadTOm</a> is licensed under <a href=https://creativecommons.org/licenses/by-sa/4.0/>Creative Commons Attribution-ShareAlike 4.0 International</a>.
         </div>
+        <br><br>
 	
     </div>
 
@@ -107,7 +110,7 @@
                     {% if kofi_settings['donations'] %}
                         {% set d_points_label = 'point' if donation_points == 1 else 'points' %}
                         {% set s_points_label = 'point' if sub_points == 1 else 'points' %}
-                        <br>&nbsp;&nbsp;You can also get {{ kofi_settings['donation_points'] }} {{ d_points_label }} for every dollar you donate on Kofi{% if kofi_settings['subs'] %}, and {{ kofi_settings['sub_points'] }} {{ s_points_label }} every month for subscribing to my Kofi page{% endif %}. 🤑
+                        <br>&nbsp;&nbsp;You can also get {{ kofi_settings['donation_points'] }} {{ d_points_label }} for every dollar you donate on Kofi{% if kofi_settings['subs'] %}, and {{ kofi_settings['sub_points'] }} {{ s_points_label }} every month for subscribing to my Kofi page{% endif %}.
                     {% endif %}
                 {% endif %}
             {% endfor %}