mirror of https://github.com/coddrago/Heroku
fix: help alphabet modules sort
parent
73c73ea9fc
commit
18370ed557
|
@ -4,6 +4,7 @@
|
||||||
# You can redistribute it and/or modify it under the terms of the GNU AGPLv3
|
# You can redistribute it and/or modify it under the terms of the GNU AGPLv3
|
||||||
# 🔑 https://www.gnu.org/licenses/agpl-3.0.html
|
# 🔑 https://www.gnu.org/licenses/agpl-3.0.html
|
||||||
|
|
||||||
|
import re
|
||||||
import difflib
|
import difflib
|
||||||
import inspect
|
import inspect
|
||||||
import logging
|
import logging
|
||||||
|
@ -304,9 +305,13 @@ class Help(loader.Module):
|
||||||
)
|
)
|
||||||
shown_warn = True
|
shown_warn = True
|
||||||
|
|
||||||
plain_.sort(key=lambda x: x.split()[1])
|
def extract_name(line):
|
||||||
core_.sort(key=lambda x: x.split()[1])
|
match = re.search(r'[\U0001F300-\U0001FAFF\U0001F900-\U0001F9FF]*\s*(name.*)', line)
|
||||||
no_commands_.sort(key=lambda x: x.split()[1])
|
return match.group(1) if match else line
|
||||||
|
|
||||||
|
plain_.sort(key=extract_name)
|
||||||
|
core_.sort(key=extract_name)
|
||||||
|
no_commands_.sort(key=extract_name)
|
||||||
|
|
||||||
await utils.answer(
|
await utils.answer(
|
||||||
message,
|
message,
|
||||||
|
|
Loading…
Reference in New Issue