lumora-bot 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lumora_bot-1.1.0/CHANGELOG.md +50 -0
- lumora_bot-1.1.0/LICENSE +21 -0
- lumora_bot-1.1.0/PKG-INFO +59 -0
- lumora_bot-1.1.0/README.md +38 -0
- lumora_bot-1.1.0/lumora_bot/__init__.py +1938 -0
- lumora_bot-1.1.0/lumora_bot/py.typed +0 -0
- lumora_bot-1.1.0/pyproject.toml +34 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Lumora Bot SDK for Python (`lumora-bot` on pip) and JavaScript (`lumora-bot` on npm).
|
|
4
|
+
Both SDKs share one version number and one feature set. Format: [Keep a Changelog](https://keepachangelog.com/),
|
|
5
|
+
versioning: [SemVer](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## 1.1.0 (2026-11-05)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Checklists:** `send_checklist` / `sendChecklist`, `checklist_toggle`, `checklist_add`, `checklist()` and the
|
|
11
|
+
`on_checklist` / `onChecklist` handler with the list state and what changed.
|
|
12
|
+
- **Reminders:** `send_reminder`, `reminder_cancel`, `reminders()` and the `on_reminder_due` / `onReminderDue` handler.
|
|
13
|
+
- **Silent messages:** `silent=True` / `{ silent: true }` on every send (no sound or notification).
|
|
14
|
+
- **Files:** `send_file(..., preview=..., thumb=...)` (custom preview shown before download), `on_file` / `onFile`
|
|
15
|
+
with an extensions filter, `ctx.file` (name, size, preview), `download_file()` / `ctx.download()`, `files()`,
|
|
16
|
+
`accept_file()`, `cancel_file()`. Received files go to `<data_dir>/downloads` by default.
|
|
17
|
+
- **More message types:** polls, stickers, location and live location, contact cards, voice messages.
|
|
18
|
+
- **Message actions:** edit, delete, pin, react, forward, mentions, reply-to, `typing`, `messages()`, `ctx.edit()` on callbacks.
|
|
19
|
+
- **Groups:** `on_new_member`, `on_member_left`, `on_added_to_group`; admin actions `group_ban`, `group_unban`,
|
|
20
|
+
`group_remove`, `group_settings` / `set_slow_mode`, `group_purge_member`, `group_leave`; `group_info`, `group_access`,
|
|
21
|
+
`member_role`, `ctx.is_group_admin`, `search_groups`; `chats="private"|"group"` filters on commands and handlers;
|
|
22
|
+
`/cmd@otherbot` is ignored.
|
|
23
|
+
- **Handler filters:** `on_text(regex)`, `on_message(pattern=, kinds=, chats=)`, `on_callback(data="buy:*")` or
|
|
24
|
+
`pattern=`, `on_event(name)` for raw events. Specific handlers win over catch-alls.
|
|
25
|
+
- **Middleware** (`bot.middleware` / `bot.use`), `on_error`, `on_start`.
|
|
26
|
+
- **Jobs:** `every(seconds)`, `daily("HH:MM")`, `after(seconds)`, `cancel(job)` for scheduled broadcasts and tasks.
|
|
27
|
+
- **Errors:** `LumoraError` with `.code`, `.message`, `.detail`, `.cmd`; `LumoraTimeout`, `RunnerStopped`,
|
|
28
|
+
`NotAllowedForBots`.
|
|
29
|
+
- **Runtime:** structured logging (JSON with `LUMORA_BOT_LOG_FORMAT=json`), Lumora Bot Runner log in
|
|
30
|
+
`<data_dir>/runner.log`, automatic restart of the runner, graceful shutdown on SIGTERM/Ctrl+C, events of one
|
|
31
|
+
conversation handled in order, a fair send queue (15 messages/s overall; per chat a burst of 5, then 1/s).
|
|
32
|
+
- Python: optional asyncio support (`async def` handlers, `bot.aio.*`, `bot.acall`). JavaScript: TypeScript
|
|
33
|
+
declarations (`lumora-bot.d.ts`).
|
|
34
|
+
- Packaging: `pyproject.toml` (`pip install lumora-bot`), `package.json` with `exports` and `types`.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- Errors are `LumoraError` (a `RuntimeError` subclass in Python), so existing `except RuntimeError` code still works.
|
|
38
|
+
In JavaScript `err.message` is now the plain sentence; the technical cause is in `err.detail`.
|
|
39
|
+
- Callbacks from a group answer in that group (`ctx.conv` is the conversation of the message whose button was pressed).
|
|
40
|
+
- Commands bots must not use (remote control, recovery phrase, backups, passwords, calls) raise `NotAllowedForBots`
|
|
41
|
+
from `call()`.
|
|
42
|
+
|
|
43
|
+
### Compatible
|
|
44
|
+
- Bots written for 1.0 run unchanged: same constructor arguments, `command`, `on_message`, `on_callback`,
|
|
45
|
+
`on_new_user`, `send`, `broadcast`, `users`, `storage`, `roles`, `call`, `ctx.reply`, `ctx.send_file`.
|
|
46
|
+
|
|
47
|
+
## 1.0.0
|
|
48
|
+
|
|
49
|
+
- First release: commands with a menu, inline buttons and callbacks, bot admins and roles, JSON storage,
|
|
50
|
+
paced broadcasts, Bot Studio tokens.
|
lumora_bot-1.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lumora
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: lumora-bot
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Lumora Bot SDK for Python: build bots for the Lumora messaging app (commands, buttons, groups, files, checklists, reminders).
|
|
5
|
+
Author: Lumora
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Keywords: lumora,bot,chatbot,messaging,sdk,end-to-end-encryption
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Topic :: Communications :: Chat
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Project-URL: Homepage, https://getlumora.pages.dev/developers/
|
|
18
|
+
Project-URL: Documentation, https://getlumora.pages.dev/developers/reference/python/
|
|
19
|
+
Project-URL: Changelog, https://getlumora.pages.dev/developers/reference/#changelog
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# lumora-bot (Python)
|
|
23
|
+
|
|
24
|
+
Build bots for the [Lumora](https://getlumora.pages.dev/) messaging app. A bot is a normal Lumora account
|
|
25
|
+
run by your code through **Lumora Bot Runner** (`lumorad`): users add it by its ID or `@name·tag`,
|
|
26
|
+
messages are end-to-end encrypted, and there is no server to rent.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install lumora-bot
|
|
30
|
+
pip install https://getlumora.pages.dev/developers/packages/lumora_bot-1.1.0-py3-none-any.whl # or the file directly
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The SDK is one file with no dependencies (`lumora_bot.py`, Python 3.8+), so copying it next to your bot works too.
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from lumora_bot import Bot
|
|
37
|
+
|
|
38
|
+
bot = Bot() # token from $LUMORA_BOT_TOKEN (Bot Studio in the app)
|
|
39
|
+
|
|
40
|
+
@bot.command("start", "Start")
|
|
41
|
+
def start(ctx):
|
|
42
|
+
ctx.reply("Hi! Pick one:", buttons=[[("👍 Like", "like")]])
|
|
43
|
+
|
|
44
|
+
@bot.on_callback(data="like")
|
|
45
|
+
def liked(ctx):
|
|
46
|
+
ctx.edit("Thanks! 👍")
|
|
47
|
+
|
|
48
|
+
bot.run()
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
export LUMORA_BOT_TOKEN="lumora_bot_..." # from Bot Studio in the Lumora app
|
|
53
|
+
export LUMORAD=/path/to/lumorad # Lumora Bot Runner
|
|
54
|
+
python3 bot.py
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Guides, the full API reference and deployment notes: <https://getlumora.pages.dev/developers/>.
|
|
58
|
+
|
|
59
|
+
License: MIT (see LICENSE). Changes: CHANGELOG.md.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# lumora-bot (Python)
|
|
2
|
+
|
|
3
|
+
Build bots for the [Lumora](https://getlumora.pages.dev/) messaging app. A bot is a normal Lumora account
|
|
4
|
+
run by your code through **Lumora Bot Runner** (`lumorad`): users add it by its ID or `@name·tag`,
|
|
5
|
+
messages are end-to-end encrypted, and there is no server to rent.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install lumora-bot
|
|
9
|
+
pip install https://getlumora.pages.dev/developers/packages/lumora_bot-1.1.0-py3-none-any.whl # or the file directly
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The SDK is one file with no dependencies (`lumora_bot.py`, Python 3.8+), so copying it next to your bot works too.
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
from lumora_bot import Bot
|
|
16
|
+
|
|
17
|
+
bot = Bot() # token from $LUMORA_BOT_TOKEN (Bot Studio in the app)
|
|
18
|
+
|
|
19
|
+
@bot.command("start", "Start")
|
|
20
|
+
def start(ctx):
|
|
21
|
+
ctx.reply("Hi! Pick one:", buttons=[[("👍 Like", "like")]])
|
|
22
|
+
|
|
23
|
+
@bot.on_callback(data="like")
|
|
24
|
+
def liked(ctx):
|
|
25
|
+
ctx.edit("Thanks! 👍")
|
|
26
|
+
|
|
27
|
+
bot.run()
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
export LUMORA_BOT_TOKEN="lumora_bot_..." # from Bot Studio in the Lumora app
|
|
32
|
+
export LUMORAD=/path/to/lumorad # Lumora Bot Runner
|
|
33
|
+
python3 bot.py
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Guides, the full API reference and deployment notes: <https://getlumora.pages.dev/developers/>.
|
|
37
|
+
|
|
38
|
+
License: MIT (see LICENSE). Changes: CHANGELOG.md.
|