Fix emoji support
This commit is contained in:
parent
0c325d07f0
commit
30e3b05596
1 changed files with 6 additions and 1 deletions
|
@ -47,10 +47,15 @@ class DbrandCog(commands.Cog):
|
|||
async def _shipping(self, ctx, *, search: str):
|
||||
if not re.match(r"^[A-Z- ]+$", search, re.IGNORECASE):
|
||||
if re.match(
|
||||
f"^[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]$",
|
||||
r"^[\U0001f1e6-\U0001f1ff]{2}$",
|
||||
search,
|
||||
re.IGNORECASE,
|
||||
):
|
||||
# Magic number, subtract from flag char to get ascii char
|
||||
uni2ascii = 127365
|
||||
search = chr(ord(search[0]) - uni2ascii) + chr(
|
||||
ord(search[1]) - uni2ascii
|
||||
)
|
||||
search = search.split("_")[1][:-1]
|
||||
else:
|
||||
await ctx.send("Please use text to search for shipping.")
|
||||
|
|
Loading…
Add table
Reference in a new issue