Changed how file extensions are checked.

This commit is contained in:
Nichole Mattera 2020-05-05 20:39:31 -04:00
parent 6bc7a0c4aa
commit 151a2b4a2a

View file

@ -2,6 +2,7 @@ import config
import discord import discord
import io import io
import urllib.parse import urllib.parse
import os.path
from discord.ext import commands from discord.ext import commands
from discord.ext.commands import Cog from discord.ext.commands import Cog
@ -101,9 +102,7 @@ class Lists(Cog):
( (
a a
for a in message.attachments for a in message.attachments
if a.filename.endswith(".png") if os.path.splitext(a.filename)[1] in [".png", ".jpg", ".jpeg"]
or a.filename.endswith(".jpg")
or a.filename.endswith(".jpeg")
), ),
None, None,
) )
@ -265,9 +264,7 @@ class Lists(Cog):
( (
a a
for a in message.attachments for a in message.attachments
if a.filename.endswith(".png") if os.path.splitext(a.filename)[1] in [".png", ".jpg", ".jpeg"]
or a.filename.endswith(".jpg")
or a.filename.endswith(".jpeg")
), ),
None, None,
) )