forked from gooberinc/goober
Update and rename songchanger to songchanger.py
This commit is contained in:
parent
7251730b66
commit
b3be8f4daa
1 changed files with 14 additions and 1 deletions
|
@ -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:
|
Loading…
Add table
Add a link
Reference in a new issue