mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 10:17:59 -05:00
[Core] Added co-owners to outdated message warnings (#2664)
* Added co-owners to potentially DMd users * Fetch the cached of every guild, see comments of #2664 * Ensure owners can be DM'd. * Refactoring try block.
This commit is contained in:
@@ -119,13 +119,25 @@ def init_events(bot, cli_flags):
|
||||
"Outdated version! {} is available "
|
||||
"but you're using {}".format(data["info"]["version"], red_version)
|
||||
)
|
||||
owner = await bot.fetch_user(bot.owner_id)
|
||||
await owner.send(
|
||||
"Your Red instance is out of date! {} is the current "
|
||||
"version, however you are using {}!".format(
|
||||
data["info"]["version"], red_version
|
||||
)
|
||||
)
|
||||
|
||||
owners = []
|
||||
owner = bot.get_user(bot.owner_id)
|
||||
if owner is not None:
|
||||
owners.append(owner)
|
||||
|
||||
for co_owner in bot._co_owners:
|
||||
co_owner = await bot.get_user(co_owner)
|
||||
if co_owner is not None:
|
||||
owners.append(co_owner)
|
||||
|
||||
for owner in owners:
|
||||
with contextlib.suppress(discord.HTTPException):
|
||||
await owner.send(
|
||||
"Your Red instance is out of date! {} is the current "
|
||||
"version, however you are using {}!".format(
|
||||
data["info"]["version"], red_version
|
||||
)
|
||||
)
|
||||
INFO2 = []
|
||||
|
||||
mongo_enabled = storage_type() != "JSON"
|
||||
|
||||
Reference in New Issue
Block a user