Move version to independent VERSION file
This commit is contained in:
@@ -0,0 +1 @@
|
||||
0.5.2
|
||||
+1
-1
@@ -21,7 +21,7 @@ class Debug_Command(Base_Cog):
|
||||
embed = discord.Embed(title="Debug Information")
|
||||
|
||||
embed.add_field(name="Version",
|
||||
value=f"`{portal.PROGRAM_VERSION}`",
|
||||
value=ctx.client.VERSION,
|
||||
inline=True)
|
||||
embed.add_field(name="Uptime",
|
||||
value=f"{get_elapsed_time_big(datetime.now().timestamp() - portal.STARTUP_TIMESTAMP)}",
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
from pathlib import Path
|
||||
|
||||
# Read VERSION file
|
||||
with open(Path(__file__).resolve().parent / "VERSION") as f:
|
||||
VERSION = f.read().strip()
|
||||
|
||||
|
||||
__all__ = VERSION
|
||||
+4
-1
@@ -13,12 +13,13 @@ from utils.portal import Portal
|
||||
import asyncio
|
||||
from typing import Union
|
||||
from platforms.reddit import Reddit_Adapter
|
||||
from const import VERSION
|
||||
|
||||
print(" ____ ____ ___________ __________")
|
||||
print(" / __ \/ __ \/ ___/_ __/ / _/_ __/")
|
||||
print(" / /_/ / / / /\__ \ / /_____ / / / / ")
|
||||
print(" / ____/ /_/ /___/ // /_____// / / / ")
|
||||
print(" /_/ \____//____//_/ /___/ /_/ ")
|
||||
print(f" /_/ \____//____//_/ /___/ /_/ v{VERSION}")
|
||||
print(" Copyright (c) 2024-2025 Lars Winzer")
|
||||
print()
|
||||
print(" Source: https://github.com/official-Cromatin/Post-It")
|
||||
@@ -44,6 +45,8 @@ class MyBot(commands.Bot):
|
||||
self.__portal:Portal
|
||||
self.__first_on_ready = False
|
||||
|
||||
self.VERSION = VERSION
|
||||
|
||||
def set_portal(self, portal:Portal):
|
||||
self.__portal = portal
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ from platforms.reddit import Reddit_Adapter
|
||||
|
||||
@Singleton
|
||||
class Portal:
|
||||
PROGRAM_VERSION = "0.3"
|
||||
bot_config:Advanced_ConfigParser = None
|
||||
platforms_config:Advanced_ConfigParser = None
|
||||
STARTUP_TIMESTAMP:float = None
|
||||
|
||||
Reference in New Issue
Block a user