Add emoji support in shipping search

This commit is contained in:
Zeva Rose 2021-06-27 17:19:30 -06:00
parent 7ea2ad736d
commit 0c325d07f0

View file

@ -46,7 +46,11 @@ class DbrandCog(commands.Cog):
@_db.command(name="shipping", aliases=["ship", "s"]) @_db.command(name="shipping", aliases=["ship", "s"])
async def _shipping(self, ctx, *, search: str): async def _shipping(self, ctx, *, search: str):
if not re.match(r"^[A-Z- ]+$", search, re.IGNORECASE): if not re.match(r"^[A-Z- ]+$", search, re.IGNORECASE):
if re.match(f"^:flag_[a-z]{2}:$", search, re.IGNORECASE): if re.match(
f"^[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]$",
search,
re.IGNORECASE,
):
search = search.split("_")[1][:-1] search = search.split("_")[1][:-1]
else: else:
await ctx.send("Please use text to search for shipping.") await ctx.send("Please use text to search for shipping.")