setguildicon: make filename grabbing slightly more reliable

This commit is contained in:
Ave Ozkal 2019-02-20 14:33:29 +03:00
parent 16ae2615bb
commit f6302f710c
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B

View file

@ -26,8 +26,9 @@ class Mod:
log_channel = self.bot.get_channel(config.modlog_channel)
log_msg = f"✏️ **Guild Icon Update**: {ctx.author} "\
"changed the guild icon."
img_filename = url.split("/")[-1].split("#")[0] # hacky
img_file = discord.File(io.BytesIO(img_bytes),
filename=url.split("/")[-1]) # hacky
filename=img_filename)
await log_channel.send(log_msg, file=img_file)
@commands.guild_only()