gsd 2 years ago
parent
commit
b9dff3590d
  1. 4
      bot.py
  2. 4
      player.py
  3. 7
      user_ext/powered.py

4
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()

4
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:

7
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)
Loading…
Cancel
Save