-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generalize modules, some minor improvements
Create `BaseModule` and `BaseHandler` classes Remove `MessageNotModified` warning Accept varargs instead of list when registering a command Register all shortcuts via decorators Allow hooks to return a value Resolve hooks and shortcuts dependencies Rename `ShortcutTransformersModule` to `ShortcutsModule` Add `MiddlewareManager.__contains__` Rename `__is_prod__` to `is_prod` Bump version to 0.5
- Loading branch information
Showing
18 changed files
with
892 additions
and
518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,9 @@ | |
#, fuzzy | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: evgfilim1/userbot 0.4.x\n" | ||
"Project-Id-Version: evgfilim1/userbot 0.5.x\n" | ||
"Report-Msgid-Bugs-To: https://github.com/evgfilim1/userbot/issues\n" | ||
"POT-Creation-Date: 2022-10-28 23:38+0500\n" | ||
"POT-Creation-Date: 2022-11-02 02:36+0500\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -152,7 +152,7 @@ msgstr "" | |
msgid "{icon} The file has been downloaded to <code>{output}</code>" | ||
msgstr "" | ||
|
||
#: userbot/commands/download.py:77 | ||
#: userbot/commands/download.py:78 | ||
msgid "<i>Downloading file(s)...</i>" | ||
msgstr "" | ||
|
||
|
@@ -234,34 +234,34 @@ msgstr "" | |
msgid "{icon} Message with key={key!r} not found" | ||
msgstr "" | ||
|
||
#: userbot/commands/notes.py:52 | ||
#: userbot/commands/notes.py:53 | ||
#, python-brace-format | ||
msgid "" | ||
"{icon} <b>File reference expired, please save the note again.</b>\n" | ||
"<i>Note key:</i> <code>{key}</code>" | ||
msgstr "" | ||
|
||
#: userbot/commands/notes.py:77 userbot/commands/notes.py:112 | ||
#: userbot/commands/notes.py:78 userbot/commands/notes.py:113 | ||
#, python-brace-format | ||
msgid "" | ||
"{icon} Please specify note key\n" | ||
"\n" | ||
"Possible fix: <code>{message_text} key</code>" | ||
msgstr "" | ||
|
||
#: userbot/commands/notes.py:87 | ||
#: userbot/commands/notes.py:88 | ||
#, python-brace-format | ||
msgid "{icon} Note <code>{key}</code> saved" | ||
msgstr "" | ||
|
||
#: userbot/commands/notes.py:98 | ||
#: userbot/commands/notes.py:99 | ||
#, python-brace-format | ||
msgid "" | ||
"{icon} <b>Saved notes:</b>\n" | ||
"{t}" | ||
msgstr "" | ||
|
||
#: userbot/commands/notes.py:116 | ||
#: userbot/commands/notes.py:117 | ||
#, python-brace-format | ||
msgid "{icon} Note <code>{key}</code> deleted" | ||
msgstr "" | ||
|
@@ -331,7 +331,25 @@ msgstr "" | |
msgid "{icon} <b>Stopping userbot...</b>" | ||
msgstr "" | ||
|
||
#: userbot/modules/commands.py:118 | ||
#: userbot/modules/base.py:103 | ||
msgid "<i>Userbot is processing the message...</i>" | ||
msgstr "" | ||
|
||
#: userbot/modules/base.py:122 | ||
#, python-brace-format | ||
msgid "" | ||
"{icon} <b>Timed out after {timeout} while processing the message.</b>\n" | ||
"<i>More info can be found in logs.</i>" | ||
msgstr "" | ||
|
||
#: userbot/modules/base.py:127 | ||
#, python-brace-format | ||
msgid "{timeout} second" | ||
msgid_plural "{timeout} seconds" | ||
msgstr[0] "" | ||
msgstr[1] "" | ||
|
||
#: userbot/modules/commands.py:206 | ||
#, python-brace-format | ||
msgid "" | ||
"{icon} <b>An error occurred during executing command.</b>\n" | ||
|
@@ -343,7 +361,7 @@ msgid "" | |
"<i>More info can be found in logs.</i>" | ||
msgstr "" | ||
|
||
#: userbot/modules/commands.py:136 | ||
#: userbot/modules/commands.py:222 | ||
#, python-brace-format | ||
msgid "" | ||
"{icon} <b>Successfully executed.</b>\n" | ||
|
@@ -353,63 +371,32 @@ msgid "" | |
"<b>Result:</b>" | ||
msgstr "" | ||
|
||
#: userbot/modules/commands.py:145 | ||
#: userbot/modules/commands.py:233 | ||
#, python-brace-format | ||
msgid "{text} <i>See reply.</i>" | ||
msgstr "" | ||
|
||
#: userbot/modules/commands.py:234 | ||
#, python-brace-format | ||
msgid "" | ||
"{icon} <b>Command timed out after {timeout}.</b>\n" | ||
"\n" | ||
"<b>Command:</b> <code>{message_text}</code>\n" | ||
"\n" | ||
"<i>More info can be found in logs.</i>" | ||
msgstr "" | ||
|
||
#: userbot/modules/commands.py:240 | ||
#, python-brace-format | ||
msgid "{timeout} second" | ||
msgid_plural "{timeout} seconds" | ||
msgstr[0] "" | ||
msgstr[1] "" | ||
|
||
#: userbot/modules/commands.py:259 | ||
#, python-brace-format | ||
msgid "<i>Executing</i> <code>{command}</code>..." | ||
msgstr "" | ||
|
||
#: userbot/modules/commands.py:301 | ||
#, python-brace-format | ||
msgid "" | ||
"{result}\n" | ||
"\n" | ||
"{icon} <i><b>MessageNotModified</b> was raised, check that there's only one instance of userbot " | ||
"is running.</i>" | ||
msgstr "" | ||
|
||
#: userbot/modules/commands.py:460 | ||
#: userbot/modules/commands.py:400 | ||
#, python-brace-format | ||
msgid "" | ||
"<b>Help for {args}:</b>\n" | ||
"{usage}" | ||
msgstr "" | ||
|
||
#: userbot/modules/commands.py:466 | ||
#: userbot/modules/commands.py:406 | ||
msgid "" | ||
"<b>List of userbot commands available:</b>\n" | ||
"\n" | ||
msgstr "" | ||
|
||
#: userbot/modules/hooks.py:27 | ||
#: userbot/modules/hooks.py:34 | ||
#, python-brace-format | ||
msgid "" | ||
"Hooks in this chat:\n" | ||
"{hooks}" | ||
msgstr "" | ||
|
||
#: userbot/modules/hooks.py:128 | ||
#: userbot/modules/hooks.py:213 | ||
#, python-brace-format | ||
msgid "" | ||
"Available hooks:\n" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
__all__ = [ | ||
"__is_prod__", | ||
"is_prod", | ||
"__version__", | ||
] | ||
|
||
from os import environ | ||
from typing import Final | ||
|
||
__is_prod__: Final[bool] = bool(environ.get("GITHUB_SHA", "")) | ||
__version__: Final[str] = "0.4.x" + ("-dev" if not __is_prod__ else "") | ||
is_prod: Final[bool] = bool(environ.get("GITHUB_SHA", "")) | ||
__version__: Final[str] = "0.5.x" + ("-dev" if not is_prod else "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.