Changelog - Version 4.3 (2024-05-17)
Added
- Added MySQL table creation for
channel_point_rewards:mysql_cursor.execute(''' CREATE TABLE IF NOT EXISTS channel_point_rewards ( reward_id TEXT, reward_title TEXT, reward_cost TEXT, custom_message TEXT, PRIMARY KEY (reward_id(255)) ) ''') - Added MySQL table creation for
poll_results:mysql_cursor.execute(''' CREATE TABLE IF NOT EXISTS poll_results ( poll_id TEXT, poll_name TEXT, poll_option_one TEXT, poll_option_two TEXT, poll_option_three TEXT, poll_option_four TEXT, poll_option_five TEXT, poll_option_one_results INTEGER, poll_option_two_results INTEGER, poll_option_three_results INTEGER, poll_option_four_results INTEGER, poll_option_five_results INTEGER, bits_used INTEGER, channel_points_used INTEGER, started_at DATETIME, ended_at DATETIME ) ''') - Added EventSubs:
"channel.channel_points_automatic_reward_redemption.add""channel.channel_points_custom_reward_redemption.add""channel.poll.begin""channel.poll.progress""channel.poll.end"
- Added event handling for channel points automatic and custom reward redemptions, and poll events:
elif event_type in ["channel.channel_points_automatic_reward_redemption.add", "channel.channel_points_custom_reward_redemption.add"]: # Handle channel points automatic and custom reward redemption events ... elif event_type in ["channel.poll.begin", "channel.poll.progress", "channel.poll.end"]: # Handle poll events ... - Added a new version command:
@commands.command(name='version') async def version_command(self, ctx): global botstarted uptime = datetime.now() - botstarted await ctx.send(f"The version that is currently running is V{VERSION}. Bot started at {botstarted.strftime('%Y-%m-%d %H:%M:%S')}, uptime is {uptime}.")
Fixed
- Fixed the MySQL query statement adding new users to the database:
- Changed from:
mysql_cursor.execute('INSERT INTO seen_users (username) VALUES (%s)', (username,)) - To:
mysql_cursor.execute('INSERT INTO seen_users (username, status) VALUES (%s, %s)', (username, "True"))
- Changed from:
- Fixed another MySQL query statement by changing the conversion of
followed_at_twitchtofollowed_at:- Changed from:
datetime_obj = datetime.strptime(followed_at_twitch, "%Y-%m-%dT%H:%M:%S.%fZ") followed_at = datetime_obj.strftime("%Y-%m-%d %H:%M:%S") - To:
time_now = datetime.now() followed_at = time_now.strftime("%Y-%m-%d %H:%M:%S")
- Changed from: