[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,9 +271,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()