mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 02:39:01 +00:00
Strip both - and _ from newcog class names
This commit is contained in:
parent
69bdc3a184
commit
73a783cd6b
@ -250,8 +250,9 @@ def newcog(parser, args):
|
||||
name = args.class_name
|
||||
else:
|
||||
name = str(directory.stem)
|
||||
if '-' in name:
|
||||
name = name.replace('-', ' ').title().replace(' ', '')
|
||||
if '-' in name or '_' in name:
|
||||
translation = str.maketrans('-_', ' ')
|
||||
name = name.translate(translation).title().replace(' ', '')
|
||||
else:
|
||||
name = name.title()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user