[Reports] Give friendly error if no report channel set (#4136)

This commit is contained in:
Dav 2020-08-06 19:12:05 +00:00 committed by GitHub
parent 297ba8f2b7
commit a9bd1c60e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -304,9 +304,16 @@ class Reports(commands.Cog):
with contextlib.suppress(discord.Forbidden, discord.HTTPException):
if val is None:
await author.send(
_("There was an error sending your report, please contact a server admin.")
)
if await self.config.guild(ctx.guild).output_channel() is None:
await author.send(
_(
"This server has no reports channel set up. Please contact a server admin."
)
)
else:
await author.send(
_("There was an error sending your report, please contact a server admin.")
)
else:
await author.send(_("Your report was submitted. (Ticket #{})").format(val))
self.antispam[guild.id][author.id].stamp()