only append search query if report requires attention from moderators

This commit is contained in:
13xforever
2018-06-05 01:50:50 +05:00
committed by Roberto Anić Banić
parent 3cce43bf1f
commit 92c8839592

21
bot.py
View File

@@ -225,16 +225,17 @@ async def report(report_kind: str, trigger: str, message: Message, reporters: Li
e.add_field(name="Channel", value=channel.mention)
e.add_field(name="Time", value=message.created_at)
e.add_field(name="Contents of offending item", value=offending_content, inline=False)
e.add_field(
name="Search query (since discord doesnt allow jump links <:panda_face:436991868547366913>)",
value="`from: {nick} during: {date} in: {channel} {text}`".format(
nick=user.name + "#" + user.discriminator,
date=message.created_at.strftime("%Y-%m-%d"),
channel=channel.name,
text=message.content.split(" ")[-1]
),
inline=False
)
if attention:
e.add_field(
name="Search query (since discord doesnt allow jump links <:panda_face:436991868547366913>)",
value="`from: {nick} during: {date} in: {channel} {text}`".format(
nick=user.name + "#" + user.discriminator,
date=message.created_at.strftime("%Y-%m-%d"),
channel=channel.name,
text=message.content.split(" ")[-1]
),
inline=False
)
if reporters is not None:
e.add_field(name="Reporters", value='\n'.join([x.mention for x in reporters]))
await bot_log.send("", embed=e)