mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
parent
6f0b3fb669
commit
10647f14b2
@ -1,8 +1,8 @@
|
||||
import datetime
|
||||
import logging
|
||||
import pkg_resources
|
||||
import traceback
|
||||
from pkg_resources import get_distribution
|
||||
from importlib.util import find_spec as find_package
|
||||
from pkg_resources import DistributionNotFound
|
||||
|
||||
|
||||
import discord
|
||||
@ -71,26 +71,29 @@ def init_events(bot, cli_flags):
|
||||
|
||||
prefixes = await bot.db.prefix()
|
||||
lang = await bot.db.locale()
|
||||
red_pkg = pkg_resources.get_distribution('Red_DiscordBot')
|
||||
dpy_version = pkg_resources.get_distribution('discord.py').version
|
||||
|
||||
INFO = [str(bot.user), "Prefixes: {}".format(', '.join(prefixes)),
|
||||
'Language: {}'.format(lang),
|
||||
"Red Bot Version: {}".format(get_distribution('Red_DiscordBot').version),
|
||||
"Discord.py Version: {}".format(get_distribution('discord.py').version),
|
||||
"Red Bot Version: {}".format(red_pkg.version),
|
||||
"Discord.py Version: {}".format(dpy_version),
|
||||
"Shards: {}".format(bot.shard_count)]
|
||||
|
||||
if guilds:
|
||||
INFO.extend(("Servers: {}".format(guilds), "Users: {}".format(users)))
|
||||
else:
|
||||
print("Ready. I'm not in any server yet!")
|
||||
|
||||
|
||||
|
||||
INFO.append('{} cogs with {} commands'.format(len(bot.cogs), len(bot.commands)))
|
||||
|
||||
INFO2 = []
|
||||
|
||||
sentry = await bot.db.enable_sentry()
|
||||
test_docs = all(find_package(x) for x in ['sphinx', 'sphinxcontrib', 'sphinx_rtd_theme',
|
||||
'pytest_asyncio', 'pytest'])
|
||||
voice = find_package('PyNaCl')
|
||||
|
||||
voice_reqs = [x.name for x in red_pkg._dep_map['voice']]
|
||||
docs_reqs = [x.name for x in red_pkg._dep_map['docs']]
|
||||
test_reqs = [x.name for x in red_pkg._dep_map['test']]
|
||||
|
||||
if sentry:
|
||||
INFO2.append("√ Report Errors")
|
||||
else:
|
||||
@ -101,16 +104,20 @@ def init_events(bot, cli_flags):
|
||||
else:
|
||||
INFO2.append("√ MongoDB")
|
||||
|
||||
if voice:
|
||||
INFO2.append("√ Voice")
|
||||
else:
|
||||
try:
|
||||
pkg_resources.require(voice_reqs)
|
||||
except DistributionNotFound:
|
||||
INFO2.append("X Voice")
|
||||
|
||||
if test_docs:
|
||||
INFO2.append("√ Tests and Docs")
|
||||
else:
|
||||
INFO2.append("X Tests and Docs")
|
||||
INFO2.append("√ Voice")
|
||||
|
||||
try:
|
||||
pkg_resources.require(docs_reqs)
|
||||
pkg_resources.require(test_reqs)
|
||||
except DistributionNotFound:
|
||||
INFO2.append("X Tests and Docs")
|
||||
else:
|
||||
INFO2.append("√ Tests and Docs")
|
||||
|
||||
print(Fore.RED + INTRO)
|
||||
print(Style.RESET_ALL)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user