adding lavalink and python version

This commit is contained in:
Mylloon 2021-08-15 10:06:36 +02:00
parent 7c95e88d05
commit 5ea16720d6
2 changed files with 19 additions and 2 deletions

View file

@ -2,8 +2,9 @@ import discord
from discord.ext import commands from discord.ext import commands
from random import randint, shuffle from random import randint, shuffle
from re import findall from re import findall
from sys import version as pyVersion
from discord_slash import cog_ext 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.core import mySendHidden, mentionToUser, getChangelogs, getActualVersion, isSlash, load, devOrStableChannel
from utils.time import nowUTC, intToDatetime, timestampScreen, getAge, ageLayout, nowCustom from utils.time import nowUTC, intToDatetime, timestampScreen, getAge, ageLayout, nowCustom
@ -238,6 +239,14 @@ class Utils(commands.Cog):
devOrMain = devOrStableChannel() 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 = "Dev", value = f"[{dev}](https://discord.gg/Z5ePxH4)")
embed.add_field(name = "Hébergeur", value = appinfo.owner.mention) embed.add_field(name = "Hébergeur", value = appinfo.owner.mention)
embed.add_field(name = f"Serveur{'s' if nombreServeur > 1 else ''}", value = f"`{nombreServeur}`") 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: if changes[0] == 200:
version = f"[{version}]({changes[1]})" version = f"[{version}]({changes[1]})"
embed.add_field(name = "Version", value = f"{version} ({devOrMain.replace('main', 'stable')})") 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: try:
if fromSlash != True: if fromSlash != True:
await ctx.message.add_reaction(emoji = '') await ctx.message.add_reaction(emoji = '')

View file

@ -191,3 +191,11 @@ def load(variables):
exit(1) exit(1)
return keys 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