diff --git a/src/cogs/citation.py b/src/cogs/citation.py index 3d2a8cd..29f43f4 100644 --- a/src/cogs/citation.py +++ b/src/cogs/citation.py @@ -49,18 +49,18 @@ class Citation(commands.Cog): desc = f"Il y a plusieurs fichiers dans ce message : {listOfFiles}" else: if len(msgFiles) == 1: - if msgFiles[0].filename[-4:].split('.')[1] in imageExtensions: + if msgFiles[0].filename.split('.')[-1] in imageExtensions: # si le fichier joint est une image if not len(msgID.content) > 0: desc = f"Une image jointe : {msgFiles[0].filename}" - else: + else: # si le fichier joint n'est pas une image linkFile = msgFiles[0].url if not len(msgID.content) > 0: desc = f"Un fichier joint : {msgFiles[0].filename}" embed = discord.Embed(description = desc, colour = couleur) try: if len(msgFiles) == 1: - if msgFiles[0].filename[-4:].split('.')[1] in imageExtensions: - embed.set_image(url=msgFiles[0].url) + if msgFiles[0].filename.split('.')[-1] in imageExtensions: + embed.set_image(url = msgFiles[0].url) else: embed.add_field(name = "Fichier", value = f"[Lien]({linkFile})", inline=True) except: