#Regex doesn't support for thai language again
1 messages · Page 1 of 1 (latest)
well there is an error in th lang again
in discord/commands/core.py line 1637 - 1660
@upper glacier
Can you discuss abt this error again?
The regex in the code matches those charecters... Let me do some more looking
Okay thank you
Can you post a full traceback?
Okay
Traceback (most recent call last):
File "C:\Users\ACER\RaidenShogun\bot.py", line 24, in <module>
RaidenBotClass.start()
File "C:\Users\ACER\RaidenShogun\bot.py", line 15, in start
bot.load_extension(f"scripts.{filename[:-3]}")
File "C:\Users\ACER\RaidenShogun\venv\lib\site-packages\discord\cog.py", line 787, in load_extension
self._load_from_module_spec(spec, name)
File "C:\Users\ACER\RaidenShogun\venv\lib\site-packages\discord\cog.py", line 718, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.errors.ExtensionFailed: Extension 'scripts.general' raised an error: TypeError: Command names and options must be of type str. Received "โปรไฟล์" in l
ocale th```
So it is a bug. I will mention it
Does not check for non-english charecters
https://github.com/Pycord-Development/pycord/blob/master/discord/commands/core.py#L1644
discord/commands/core.py line 1644
if not isinstance(name, str) or not re.match(r"^[\w-]{1,32}$", name):```
yes
this bug is the second time now.
@upper glacier have fixed this pr before
What it looks like to me is that IlluminatiFish fixed it right before permissions V2 was released and they did a bad job at the merge conflicts.
yeah
Maybe this part must remove
if not isinstance(name, str) or not re.match(r"^[\w-]{1,32}$", name):
error = TypeError(f'Command names and options must be of type str. Received "{name}"')```
The regex part needs to be updated or removed
I cant pin who added that line though. Im not sure why the regex is needed there.
yes i dunno also
okay the issue is only this code
cuz i have comment this part then the bot works as expected
Ok, still trying to find who made that change so I can ask them why.
Pull request :
Update validation regex for command names & options
From :
if not isinstance(name, str) or not re.match(r"^[\w-]{1,32}$", name):
error = TypeError(f'Command names and options must be of type str. Received "{name}"')
To :
if not isinstance(name, str):
error = TypeError(f'Command names and options must be of type str. Received "{name}"')
Yeah to me that makes sense.
yes just check for string.
It shouldn't have to match regex to determine if it is a string becouse regex only works on strings lol
I'm unable to make an issue or PR right now. Will you do this or should I later
oh nvm i will pull request that
Ok.
Is rc1 ahead of master. That code is in master
rc1 was released yesterday and that pr was merged about 2 weeks ago
i'm in py-cord 2.0.0rc1
The PR that fixed it got overwritten. I think someone did a bad job at merge conflicts as something was added just a day later thay made it break
my internet quite unstable rn...
I can do it in a few hours if you cant
okay my internet stable rn
can you git blame it and check what happened
oh it was perms v2
https://www.github.com/Pycord-Development/pycord/tree/master/discord%2Fcommands%2Fcore.py#L1652-L1653 is this needed? seems like the regex already checks for this?
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API - pycord/core.py at master · Pycord-Development/pycord
if nobody else does I can open a PR later tonight
##1372 is open to fix this
Summary
Fixes changes that were previously made by accident due to a merge conflict in perms v2.
As discussed in: https://discord.com/channels/881207955029110855/976454667045322772
Checklist
If ...
Oh thank you
I didnt see any merge conflicts at the time.
wasn't your issue
when they merged perms v2 it ended up rolling back your pr