Version 3.1 (2024-03-24)
Added
- Edited the lurking command to show months lurking if the user has been lurking for more than 30 days.
- Added “checkupdate” command to the mod commands list.
- Added the “raid_data” database table.
- Started adding code for the song command which is coming soon.
- Added
TWITCH_GQLToken. - Added
SHAZAM_API.
Code Additions
- Added code for the song command:
- From Version 3.0, we introduced the following imports:
import random import base64 import streamlink
These are utilized in the implementation of the song command to handle audio data and interact with streaming content.
@commands.command(name='song')
async def get_current_song(self, ctx):
await ctx.send("Please stand by, checking what song is currently playing...")
try:
song_info = await get_song_info_command()
await ctx.send(song_info)
except Exception as e:
chat_logger.error(f"An error occurred while getting current song: {e}")
await ctx.send("Sorry, there was an error retrieving the current song.")
Functions Added for Song Command
- Function to get the current playing song:
async def get_song_info_command():
# Function implementation
- Function to get song info:
async def get_song_info():
# Function implementation
- Function to check Twitch GQL token validity:
async def twitch_gql_token_valid():
# Function implementation
- Function to detect song:
async def detect_song(raw_audio_b64):
# Function implementation
- Function to convert audio to raw format:
async def convert_to_raw_audio(in_file, out_file):
# Function implementation
- Function to record stream:
async def record_stream(outfile):
# Function implementation