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),
|
||||
])
|
||||
|
||||
|
27
ModWinDog/Percenter/Percenter.yaml
Normal file → Executable file
27
ModWinDog/Percenter/Percenter.yaml
Normal file → Executable file
@@ -1,3 +1,30 @@
|
||||
summary:
|
||||
en: Provides fun trough percentage-based toys.
|
||||
endpoints:
|
||||
wish:
|
||||
empty:
|
||||
en: |
|
||||
<b>You wished for nothing! ✨</b>
|
||||
|
||||
<i>Nothing happens...</i>
|
||||
it: |
|
||||
<b>Non hai desiderato nulla! ✨</b>
|
||||
|
||||
<i>Non succede niente...</i>
|
||||
done:
|
||||
en: |
|
||||
<b>Your wish has been cast! ✨</b>
|
||||
|
||||
<i>Chance of success: <b>{0}%</b>.</i>
|
||||
it: |
|
||||
<b>Il tuo desiderio è stato espresso! ✨</b>
|
||||
|
||||
<i>Probabilità che si avveri: <b>{0}%</b>.</i>
|
||||
level:
|
||||
summary:
|
||||
en: Check what's your level of something.
|
||||
it: Controlla il tuo livello di qualcosa.
|
||||
done:
|
||||
en: <i>Your level of <b>{1}</b> is... <b>{0}%</b>.</i>
|
||||
it: <i>Il tuo livello di <b>{1}</b> è... <b>{0}%</b>.</i>
|
||||
|
||||
|
Reference in New Issue
Block a user