[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 jack1142
parent e463c307ea
commit 574dabbeac

View File

@@ -271,6 +271,13 @@ class Reports(commands.Cog):
with contextlib.suppress(discord.Forbidden, discord.HTTPException): with contextlib.suppress(discord.Forbidden, discord.HTTPException):
if val is None: if val is None:
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( await author.send(
_("There was an error sending your report, please contact a server admin.") _("There was an error sending your report, please contact a server admin.")
) )