From b3be8f4daa830e9730778707a3566ac367510683 Mon Sep 17 00:00:00 2001 From: WhatDidYouExpect <89535984+WhatDidYouExpect@users.noreply.github.com> Date: Wed, 26 Feb 2025 21:24:24 +0100 Subject: [PATCH] Update and rename songchanger to songchanger.py --- customcommands/{songchanger => songchanger.py} | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) rename customcommands/{songchanger => songchanger.py} (59%) diff --git a/customcommands/songchanger b/customcommands/songchanger.py similarity index 59% rename from customcommands/songchanger rename to customcommands/songchanger.py index 280e85d..249e776 100644 --- a/customcommands/songchanger +++ b/customcommands/songchanger.py @@ -1,12 +1,25 @@ import discord from discord.ext import commands -from config import RED, GREEN, RESET +from config import RED, GREEN, RESET, LOCAL_VERSION_FILE +import os + class songchange(commands.Cog): def __init__(self, bot): self.bot = bot + def get_local_version(): + if os.path.exists(LOCAL_VERSION_FILE): + with open(LOCAL_VERSION_FILE, "r") as f: + return f.read().strip() + return "0.0.0" + + global local_version + local_version = get_local_version() + @commands.command() async def changesong(self, ctx): + if LOCAL_VERSION_FILE < "0.11.8": + await ctx.send(f"Goober is too old! you must have version 0.11.8 you have {local_version}") await ctx.send("Check the terminal! (this does not persist across restarts)") song = input("\nEnter a song:\n") try: