From 2073d5eb933da37bd6f4c0a260a82e5ecdf24ca1 Mon Sep 17 00:00:00 2001 From: "Mr.Miss" Date: Wed, 31 Mar 2021 00:58:31 +0700 Subject: [PATCH] core: add version info Signed-off-by: Mr.Miss --- anjani_bot/core/anjani.py | 7 ++++++- anjani_bot/version.py | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 anjani_bot/version.py diff --git a/anjani_bot/core/anjani.py b/anjani_bot/core/anjani.py index d24b3008e..2c0a70746 100644 --- a/anjani_bot/core/anjani.py +++ b/anjani_bot/core/anjani.py @@ -19,12 +19,14 @@ import logging import time from typing import List, Optional +from sys import version_info import aiohttp import aiorun import pyrogram from ..utils import get_readable_time +from ..version import __version__ from . import pool from .database import DataBase from .plugin_extender import PluginExtender # pylint: disable=R0401 @@ -42,6 +44,7 @@ class Anjani(TelegramBot, DataBase, PluginExtender): def __init__(self): self.stopping = False + self.version = __version__ self._start_time = time.time() # Init Base @@ -52,10 +55,12 @@ def __str__(self): output += f"Username : {self.username}\n" output += f"ID : {self.identifier}\n" output += f"Uptime: {self.uptime}\n" - output += f"Pyrogram: {self.client.app_version}\n" output += f"Language: {self.language}\n" output += f"Loaded Plugins:{json.dumps(list(self.plugins.keys()), indent=2)}\n" output += f"Staff list:{json.dumps(self.staff, indent=2)}\n" + output += f"Python: {version_info[0]}.{version_info[1]}.{version_info[2]}\n" + output += f"Pyrogram: {pyrogram.__version__}\n" + output += f"Anjani: {self.version}\n" return output @property diff --git a/anjani_bot/version.py b/anjani_bot/version.py new file mode 100644 index 000000000..1a9366383 --- /dev/null +++ b/anjani_bot/version.py @@ -0,0 +1,19 @@ +"""Anjani - Telegram group management bot""" +# Copyright (C) 2020 - 2021 UserbotIndo Team, +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +__version__ = "1.1.0" +__license__ = "GNU General Public License v3.0 or later (LGPLv3+)" +__copyright__ = "Copyright (C) 2020 - 2021 UserbotIndo Team, "