mod: Put jump links to mod actions

Closes #43
This commit is contained in:
Ave 2020-05-29 18:06:45 +03:00
parent 3696bcef5e
commit 944e4256b3
No known key found for this signature in database
GPG key ID: 398DD7BD03276F6D

View file

@ -25,7 +25,8 @@ class Mod(Cog):
await ctx.send(f"Done!")
log_channel = self.bot.get_channel(config.modlog_channel)
log_msg = f"✏️ **Guild Icon Update**: {ctx.author} changed the guild icon."
log_msg = (f"✏️ **Guild Icon Update**: {ctx.author} changed the guild icon."
f"\n\nJump: <{ctx.message.jump_url}>")
img_filename = url.split("/")[-1].split("#")[0] # hacky
img_file = discord.File(io.BytesIO(img_bytes), filename=img_filename)
await log_channel.send(log_msg, file=img_file)
@ -80,6 +81,8 @@ class Mod(Cog):
" as the reason is automatically sent to the user."
)
chan_message += f"\n\nJump: <{ctx.message.jump_url}>"
log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message)
await ctx.send(f"{target.mention} can no longer speak.")
@ -101,6 +104,8 @@ class Mod(Cog):
f"🏷 __User ID__: {target.id}\n"
)
chan_message += f"\n\nJump: <{ctx.message.jump_url}>"
log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message)
await ctx.send(f"{target.mention} can now speak again.")
@ -159,6 +164,8 @@ class Mod(Cog):
" as the reason is automatically sent to the user."
)
chan_message += f"\n\nJump: <{ctx.message.jump_url}>"
log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message)
await ctx.send(f"👢 {safe_name}, 👍.")
@ -216,6 +223,8 @@ class Mod(Cog):
" as the reason is automatically sent to the user."
)
chan_message += f"\n\nJump: <{ctx.message.jump_url}>"
log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message)
await ctx.send(f"{safe_name} is now b&. 👍")
@ -259,6 +268,8 @@ class Mod(Cog):
"`.hackban <user> [reason]`."
)
chan_message += f"\n\nJump: <{ctx.message.jump_url}>"
log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message)
await ctx.send(f"{safe_name} is now b&. 👍")
@ -288,6 +299,8 @@ class Mod(Cog):
"`.unban <user id> [reason]`."
)
chan_message += f"\n\nJump: <{ctx.message.jump_url}>"
log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message)
await ctx.send(f"{safe_name} is now unb&.")
@ -329,6 +342,8 @@ class Mod(Cog):
" as the reason is automatically sent to the user."
)
chan_message += f"\n\nJump: <{ctx.message.jump_url}>"
log_channel = self.bot.get_channel(config.modlog_channel)
await log_channel.send(chan_message)
@ -354,6 +369,7 @@ class Mod(Cog):
await log_channel.send(
f"✅ Approved: {ctx.author.mention} added" f" {role} to {target.mention}"
f"\n\nJump: <{ctx.message.jump_url}>"
)
@commands.guild_only()
@ -379,6 +395,7 @@ class Mod(Cog):
await log_channel.send(
f"❌ Un-approved: {ctx.author.mention} removed"
f" {role} from {target.mention}"
f"\n\nJump: <{ctx.message.jump_url}>"
)
@commands.guild_only()
@ -471,6 +488,9 @@ class Mod(Cog):
", it is recommended to use `.warn <user> [reason]`"
" as the reason is automatically sent to the user."
)
chan_msg += f"\n\nJump: <{ctx.message.jump_url}>"
await log_channel.send(chan_msg)
@commands.guild_only()