diff --git a/src/cogs/utils.py b/src/cogs/utils.py index 543a694..4a1ba76 100644 --- a/src/cogs/utils.py +++ b/src/cogs/utils.py @@ -2,8 +2,9 @@ import discord from discord.ext import commands from random import randint, shuffle from re import findall +from sys import version as pyVersion from discord_slash import cog_ext -from utils.core import map_list_among_us, cleanCodeStringWithMentionAndURLs, cleanUser, userOrNick +from utils.core import map_list_among_us, cleanCodeStringWithMentionAndURLs, cleanUser, userOrNick, getLavalinkVersion from utils.core import mySendHidden, mentionToUser, getChangelogs, getActualVersion, isSlash, load, devOrStableChannel from utils.time import nowUTC, intToDatetime, timestampScreen, getAge, ageLayout, nowCustom @@ -238,6 +239,14 @@ class Utils(commands.Cog): devOrMain = devOrStableChannel() + lavalink = getLavalinkVersion() + if lavalink: + lavalink = f", lavalink {lavalink}" + else: + lavalink = "" + + python = f" et Python {pyVersion[:5]}." + embed.add_field(name = "Dev", value = f"[{dev}](https://discord.gg/Z5ePxH4)") embed.add_field(name = "Hébergeur", value = appinfo.owner.mention) embed.add_field(name = f"Serveur{'s' if nombreServeur > 1 else ''}", value = f"`{nombreServeur}`") @@ -251,7 +260,7 @@ class Utils(commands.Cog): if changes[0] == 200: version = f"[{version}]({changes[1]})" embed.add_field(name = "Version", value = f"{version} ({devOrMain.replace('main', 'stable')})") - embed.set_footer(text = f"Basé sur discord.py {discord.__version__}") + embed.set_footer(text = f"Basé sur discord.py {discord.__version__}{lavalink}{python}") try: if fromSlash != True: await ctx.message.add_reaction(emoji = '✅') diff --git a/src/utils/core.py b/src/utils/core.py index 419ef99..1af9f3e 100644 --- a/src/utils/core.py +++ b/src/utils/core.py @@ -191,3 +191,11 @@ def load(variables): exit(1) return keys + +def getLavalinkVersion(): + with open(path.join(path.dirname(path.dirname(__file__)), "lavalink/README.md"), "r") as file: + ver = findall(r'Version \*\*(\d+.+)\*\*', file.readlines()[2]) + if len(ver) == 1: + return ver[0] + else: + return None