6 次代码提交 bf463930bd ... c2039cdb31

作者 SHA1 备注 提交日期
  deadtom c2039cdb31 Increased alert display time to 15 seconds 3 周之前
  deadtom 508cbd0419 Now moves kofi related variables from config.py to alerts.py, and adds gb_name dicitonary entry to alerts.py 3 周之前
  deadtom 5f438927de Updated version numbers 3 周之前
  deadtom 2b6e064ac1 finished givebutter functions changes 3 周之前
  deadtom fe08aadfb7 Changed some debug log entries to info 3 周之前
  deadtom 4df5c6b09b Removed last of the givebutter todos 3 周之前

+ 0 - 2
TODO.md

@@ -1,3 +1 @@
-* GiveButter integration
- * Alert overlay?
 * Short video tutorials on configuring OwnchatBot.

+ 1 - 1
ownchatbot/templates/follower.html

@@ -46,7 +46,7 @@
                             alertVid.style.display = 'none';
                             alertImg.style.display = 'none';
                             nameBox.style.display = 'none';
-                        }, 10000); // Visible for 10 seconds
+                        }, 15000); // Visible for 15 seconds
                     }
                 });
         }, 3000); // Check for new followers every 3 seconds

+ 11 - 11
ownchatbot/templates/mgmt.html

@@ -668,22 +668,22 @@
                     <td>{{ settings_info[8] }}/alert/goal</td>
                 </tr>
                 <tr>
-                    <form id="new_gb_image_upload" action="/mgmt/alertupload/GB_ALERT" method="post" enctype="multipart/form-data">
-                    <td>Goal Reached:</td>
-                    {% set gb_alert = alerts_dict["GB_ALERT"] %}
-                    {% if gb_alert %}
-                        {% if "webm" in gb_alert %}
-                            <td><video height="100" autoplay loop><source src="{{ url_for('web_panels.assets', asset_name=gb_alert) }}" type="video/webm"></video></td>
+                    <form id="new_givebutter_image_upload" action="/mgmt/alertupload/GIVEBUTTER_ALERT" method="post" enctype="multipart/form-data">
+                    <td>GiveButter Donation:</td>
+                    {% set givebutter_alert = alerts_dict["GIVEBUTTER_ALERT"] %}
+                    {% if givebutter_alert %}
+                        {% if "webm" in givebutter_alert %}
+                            <td><video height="100" autoplay loop><source src="{{ url_for('web_panels.assets', asset_name=givebutter_alert) }}" type="video/webm"></video></td>
                         {% else %}
-                            <td><img alt="User Configurable Image" src="{{ url_for('web_panels.assets', asset_name=gb_alert) }}"></td>
+                            <td><img alt="User Configurable Image" src="{{ url_for('web_panels.assets', asset_name=givebutter_alert) }}"></td>
                         {% endif %}
                     {% else %}
                         <td>Empty</td>
                     {% endif %}
-                    <td><input type="file" name="GB_ALERT" accept=".gif, .jpg, .jpeg, .png, .webm" required></td>
-                    <td><button id="new_gb_image_upload" class="button button2" type="submit">Upload</button></form>&nbsp
-                        <a href="{{ url_for('web_panels.del_alert', alert_type='GB_ALERT') }}"><button id="new_gb_image_upload" class="button button2" onclick="openTab(event, 'alerts')"><span style="color: yellow;">Clear</span></button></a></td>
-                    <td>{{ settings_info[8] }}/alert/goal</td>
+                    <td><input type="file" name="GIVEBUTTER_ALERT" accept=".gif, .jpg, .jpeg, .png, .webm" required></td>
+                    <td><button id="new_givebutter_image_upload" class="button button2" type="submit">Upload</button></form>&nbsp
+                        <a href="{{ url_for('web_panels.del_alert', alert_type='GIVEBUTTER_ALERT') }}"><button id="new_givebutter_image_upload" class="button button2" onclick="openTab(event, 'alerts')"><span style="color: yellow;">Clear</span></button></a></td>
+                    <td>{{ settings_info[8] }}/alert/givebutter</td>
                 </tr>
         </table>
         <h3>Stream Overlays</h3>

+ 1 - 1
ownchatbot/templates/rgbdonation.html

@@ -46,7 +46,7 @@
                             alertVid.style.display = 'none';
                             alertImg.style.display = 'none';
                             nameBox.style.display = 'none';
-                        }, 10000); // Visible for 10 seconds
+                        }, 15000); // Visible for 15 seconds
                     }
                 });
         }, 3000); // Check for new donation every 3 seconds

+ 1 - 1
ownchatbot/templates/rgoal.html

@@ -46,7 +46,7 @@
                             alertVid.style.display = 'none';
                             alertImg.style.display = 'none';
                             nameBox.style.display = 'none';
-                        }, 10000); // Visible for 10 seconds
+                        }, 15000); // Visible for 15 seconds
                     }
                 });
         }, 3000); // Check for new goal every 3 seconds

+ 1 - 1
ownchatbot/templates/rmilestone.html

@@ -46,7 +46,7 @@
                             alertVid.style.display = 'none';
                             alertImg.style.display = 'none';
                             nameBox.style.display = 'none';
-                        }, 10000); // Visible for 10 seconds
+                        }, 15000); // Visible for 15 seconds
                     }
                 });
         }, 3000); // Check for new milestone every 3 seconds

+ 1 - 1
ownchatbot/web_panels.py

@@ -718,7 +718,7 @@ def ocb_alert(alert_type):
     elif alert_type == 'GOAL_ALERT':
         return render_template('rgoal.html',
                                alert_name=alert_name)
-    elif alert_type == 'GB_ALERT':
+    elif alert_type == 'GIVEBUTTER_ALERT':
         return render_template('rgbdonation.html',
                                alert_name=alert_name)
 

+ 2 - 2
ownchatbot/webhooks.py

@@ -282,7 +282,7 @@ def check_goals():
     alerts_dict = current_app.config['ALERTS']
     rgoals = {'name': alerts_dict['g_name']}
     if rgoals['name']:
-        current_app.logger.debug(rgoals)
+        current_app.logger.info(rgoals)
         alerts_dict['g_name'] = ''
         alerts_dict['g_reward'] = ''
         save_alerts(alerts_dict)
@@ -312,7 +312,7 @@ def check_gbs():
     alerts_dict = current_app.config['ALERTS']
     rgbs = {'name': alerts_dict['gb_name']}
     if rgbs['name']:
-        current_app.logger.debug(rgbs)
+        current_app.logger.info(rgbs)
         alerts_dict['gb_name'] = ''
         save_alerts(alerts_dict)
         return jsonify(rgbs)

+ 1 - 1
pyproject.toml

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "ownchatbot"
-version = "1.1.dev9"
+version = "1.1.9"
 authors = [
     {name = "DeadTOm", email = "deadtom@deadtom.me"},
 ]

+ 1 - 1
setup.py

@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
 
 setup(
     name='ownchatbot',
-    version='1.1.dev9',
+    version='1.1.9',
     packages=find_packages(),
     include_package_data=True,
     install_requires=[

+ 2 - 0
upgrade.sh

@@ -28,6 +28,8 @@ update_config() {
     sed -i "/^KOFI_TOKEN/d" instance/config.py  # Delete KOFI_TOKEN line from config.py
     sed -i "/^KOFI_INTEGRATION/d" instance/config.py  # Delete KOFI_INTEGRATION line from config.py
 
+    sed -i "s/}/,\"gb_name\"": \"\"}/" instance/alerts.py  # Append those values to kofi.py
+    
     cp ownchatbot/defaults/givebutter.py instance/  # Copy the default givebutter config file into instance/
 }