Merge branch 'V3/release/3.0.0' into V3/develop

# Conflicts:
#	redbot/cogs/mod/mod.py
This commit is contained in:
Toby Harradine
2019-01-11 16:42:42 +11:00
18 changed files with 529 additions and 503 deletions

View File

@@ -1173,6 +1173,9 @@ class Core(commands.Cog, CoreLogic):
await ctx.send(
_("A backup has been made of this instance. It is at {}.").format(backup_file)
)
if backup_file.stat().st_size > 8_000_000:
await ctx.send(_("This backup is to large to send via DM."))
return
await ctx.send(_("Would you like to receive a copy via DM? (y/n)"))
pred = MessagePredicate.yes_or_no(ctx)
@@ -1183,10 +1186,18 @@ class Core(commands.Cog, CoreLogic):
else:
if pred.result is True:
await ctx.send(_("OK, it's on its way!"))
async with ctx.author.typing():
await ctx.author.send(
_("Here's a copy of the backup"), file=discord.File(str(backup_file))
try:
async with ctx.author.typing():
await ctx.author.send(
_("Here's a copy of the backup"),
file=discord.File(str(backup_file)),
)
except discord.Forbidden:
await ctx.send(
_("I don't seem to be able to DM you. Do you have closed DMs?")
)
except discord.HTTPException:
await ctx.send(_("I could not send the backup file."))
else:
await ctx.send(_("OK then."))
else: