Files
homelab/userbot/utils/misc.py
T
forust 3c383db9a7
Deploy to Server / deploy (push) Has been cancelled
refactor: extract userbot to standalone repo, add as git submodule
userbot now lives at ssh://git@gitssh.forust.xyz:2221/forust/userbot.git
and is included in homelab as a submodule at userbot/
2026-06-19 15:39:00 +02:00

34 lines
706 B
Python

from sys import version_info
import git
from .db import db
__all__ = [
'modules_help',
'requirements_list',
'python_version',
'prefix',
'gitrepo',
'userbot_version',
]
modules_help = {}
requirements_list = []
python_version = f'{version_info[0]}.{version_info[1]}.{version_info[2]}'
prefix = db.get('core.main', 'prefix', '.')
try:
gitrepo = git.Repo('.')
except (git.exc.InvalidGitRepositoryError, git.exc.NoSuchPathError):
gitrepo = None
if gitrepo is not None and len(gitrepo.tags) > 0:
commits_since_tag = list(gitrepo.iter_commits(f'{gitrepo.tags[-1].name}..HEAD'))
userbot_version = f'2.5.{len(commits_since_tag)}'
else:
userbot_version = '2.5.0'