setguildicon: Fix logging
This commit is contained in:
parent
6e64367efa
commit
16ae2615bb
1 changed files with 5 additions and 3 deletions
|
@ -19,14 +19,16 @@ class Mod:
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def setguildicon(self, ctx, url):
|
async def setguildicon(self, ctx, url):
|
||||||
"""Changes guild icon, bot manager only."""
|
"""Changes guild icon, bot manager only."""
|
||||||
imagebytes = await self.bot.aiogetbytes(url)
|
img_bytes = await self.bot.aiogetbytes(url)
|
||||||
await ctx.guild.edit(icon=imagebytes, reason=str(ctx.author))
|
await ctx.guild.edit(icon=img_bytes, reason=str(ctx.author))
|
||||||
await ctx.send(f"Done!")
|
await ctx.send(f"Done!")
|
||||||
|
|
||||||
log_channel = self.bot.get_channel(config.modlog_channel)
|
log_channel = self.bot.get_channel(config.modlog_channel)
|
||||||
log_msg = f"✏️ **Guild Icon Update**: {ctx.author} "\
|
log_msg = f"✏️ **Guild Icon Update**: {ctx.author} "\
|
||||||
"changed the guild icon."
|
"changed the guild icon."
|
||||||
await log_channel.send(log_msg, file=io.BytesIO(imagebytes))
|
img_file = discord.File(io.BytesIO(img_bytes),
|
||||||
|
filename=url.split("/")[-1]) # hacky
|
||||||
|
await log_channel.send(log_msg, file=img_file)
|
||||||
|
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
@commands.check(check_if_staff)
|
@commands.check(check_if_staff)
|
||||||
|
|
Loading…
Reference in a new issue