mirror of
https://gitlab.com/octospacc/WinDog.git
synced 2025-06-05 22:09:20 +02:00
Cleanup Locale system, remove legacy Locale API, add command help handling, misc
This commit is contained in:
@@ -4,10 +4,13 @@
|
||||
# ==================================== #
|
||||
|
||||
def mPercenter(context:EventContext, data:InputMessageData) -> None:
|
||||
SendMessage(context, {"Text": choice(Locale.__(f'{data.command.name}.{"done" if data.command.body else "empty"}')).format(
|
||||
Cmd=data.command.tokens[0], Percent=RandPercent(), Thing=data.command.body)})
|
||||
SendMessage(context, {"text_html": (context.endpoint.get_string(
|
||||
("done" if data.command.body else "empty"),
|
||||
data.user.settings.language
|
||||
) or context.endpoint.help_text(data.user.settings.language)
|
||||
).format(RandPercent(), data.command.body)})
|
||||
|
||||
RegisterModule(name="Percenter", endpoints=[
|
||||
SafeNamespace(names=["wish", "level"], handler=mPercenter),
|
||||
SafeNamespace(names=["wish", "level"], handler=mPercenter, body=True),
|
||||
])
|
||||
|
||||
|
Reference in New Issue
Block a user