1
0
Fork 0
mirror of https://github.com/uhIgnacio/EmoteManager.git synced 2024-08-15 02:23:13 +00:00

fix em/add with attachments

This commit is contained in:
io mintz 2020-07-06 04:52:34 +00:00
parent 30c16b8b8c
commit 14a82561e7

View file

@ -200,7 +200,8 @@ class Emotes(commands.Cog):
@staticmethod @staticmethod
def format_emote_filename(filename): def format_emote_filename(filename):
"""format a filename to an emote name as discord does when you upload an emote image""" """format a filename to an emote name as discord does when you upload an emote image"""
return posixpath.splitext(filename)[0].rpartition('-')[0].replace(' ', '') left, sep, right = posixpath.splitext(filename)[0].rpartition('-')
return (left or right).replace(' ', '')
@commands.command(name='add-from-ec', aliases=['addfromec']) @commands.command(name='add-from-ec', aliases=['addfromec'])
async def add_from_ec(self, context, name, *names): async def add_from_ec(self, context, name, *names):