diff --git a/bot.py b/bot.py index 9011b18..1d880b6 100644 --- a/bot.py +++ b/bot.py @@ -61,6 +61,7 @@ class DiscordClient(commands.Bot): self.loop.create_task(self.loaded_extensions["stats_presence"].task()) self.loop.create_task(self.loaded_extensions["vip_roles"].task()) self.loop.create_task(self.loaded_extensions["ban_roles"].task()) + self.loop.create_task(self.loaded_extensions["register"].task()) def setup_events(self): @self.event @@ -159,6 +160,9 @@ class DiscordClient(commands.Bot): else: print("backend is up, continue build app") + def utime2human(self, utime): + return datetime.fromtimestamp(utime).strftime('%H:%M:%S %d.%m.%Y') + if __name__ == "__main__": print(f"Build date: {os.getenv('BUILDDATE', 'not setted in env')}") parser = argparse.ArgumentParser() diff --git a/player.py b/player.py index 901964a..2675b88 100644 --- a/player.py +++ b/player.py @@ -103,10 +103,10 @@ class Player: message += f"Дата разбана: {utime2human(self.current['ban']['ban_utime'] + self.current['ban']['ban_length_seconds'])}\n" embed.add_field(name="Имеется бан на сервере", value=message, inline=False) #Привязаные профили ранее - if self.current.get("attached_discord", []): + if self.current.get("attached_discords", []): message_head = "" message = "" - for d in self.current.get("attached_discord", []): + for d in self.current.get("attached_discords", []): if d['active'] == 1: message_head += f"<@{d['discord_id']}> | {utime2human(d['u_time'])}" else: diff --git a/user_ext/powered.py b/user_ext/powered.py index 0daa7d7..f6118c5 100644 --- a/user_ext/powered.py +++ b/user_ext/powered.py @@ -1,7 +1,10 @@ -import discord +import discord, os class Extension: + core = None def __init__(self, core): + self.core = core + @core.tree.command(name = "powered", description = "Информация о боте") async def powered( interaction: discord.Interaction @@ -12,4 +15,6 @@ class Extension: Создан на основе: https://github.com/Rapptz/discord.py ({discord.__version__}) Исходник бота: https://git.pblr-nyk.pro/gsd/Facti13.Bot.Discord.V2 Исходник сервисов: https://git.pblr-nyk.pro/gsd/Facti13.Web.Backend.Java.V2 + +Версия сборки от {self.core.utime2human(os.getenv("BUILDDATE", "0"))} """, ephemeral=False) \ No newline at end of file