mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[V3 CLI] CLI prefix args correctly display in the on_ready print (#1770)
This commit is contained in:
parent
a6965c4b5a
commit
741f3cbdcc
@ -96,7 +96,7 @@ def init_events(bot, cli_flags):
|
|||||||
else:
|
else:
|
||||||
invite_url = None
|
invite_url = None
|
||||||
|
|
||||||
prefixes = await bot.db.prefix()
|
prefixes = cli_flags.prefix or (await bot.db.prefix())
|
||||||
lang = await bot.db.locale()
|
lang = await bot.db.locale()
|
||||||
red_version = __version__
|
red_version = __version__
|
||||||
red_pkg = pkg_resources.get_distribution("Red-DiscordBot")
|
red_pkg = pkg_resources.get_distribution("Red-DiscordBot")
|
||||||
@ -118,24 +118,24 @@ def init_events(bot, cli_flags):
|
|||||||
|
|
||||||
INFO.append("{} cogs with {} commands".format(len(bot.cogs), len(bot.commands)))
|
INFO.append("{} cogs with {} commands".format(len(bot.cogs), len(bot.commands)))
|
||||||
|
|
||||||
async with aiohttp.ClientSession() as session:
|
try:
|
||||||
async with session.get("https://pypi.python.org/pypi/red-discordbot/json") as r:
|
async with aiohttp.ClientSession() as session:
|
||||||
data = await r.json()
|
async with session.get("https://pypi.python.org/pypi/red-discordbot/json") as r:
|
||||||
if StrictVersion(data["info"]["version"]) > StrictVersion(red_version):
|
data = await r.json()
|
||||||
INFO.append(
|
if StrictVersion(data["info"]["version"]) > StrictVersion(red_version):
|
||||||
"Outdated version! {} is available "
|
INFO.append(
|
||||||
"but you're using {}".format(data["info"]["version"], red_version)
|
"Outdated version! {} is available "
|
||||||
)
|
"but you're using {}".format(data["info"]["version"], red_version)
|
||||||
owner = discord.utils.get(bot.get_all_members(), id=bot.owner_id)
|
)
|
||||||
try:
|
owner = discord.utils.get(bot.get_all_members(), id=bot.owner_id)
|
||||||
await owner.send(
|
await owner.send(
|
||||||
"Your Red instance is out of date! {} is the current "
|
"Your Red instance is out of date! {} is the current "
|
||||||
"version, however you are using {}!".format(
|
"version, however you are using {}!".format(
|
||||||
data["info"]["version"], red_version
|
data["info"]["version"], red_version
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
INFO2 = []
|
INFO2 = []
|
||||||
|
|
||||||
sentry = await bot.db.enable_sentry()
|
sentry = await bot.db.enable_sentry()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user