vibehub 1.0.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.
- vibehub-1.0.0/LICENSE +21 -0
- vibehub-1.0.0/MANIFEST.in +6 -0
- vibehub-1.0.0/PKG-INFO +73 -0
- vibehub-1.0.0/README.md +54 -0
- vibehub-1.0.0/pyproject.toml +33 -0
- vibehub-1.0.0/setup.cfg +4 -0
- vibehub-1.0.0/src/Vibe/__init__.py +23 -0
- vibehub-1.0.0/src/Vibe/__main__.py +3 -0
- vibehub-1.0.0/src/Vibe/bot.py +491 -0
- vibehub-1.0.0/src/Vibe/cli.py +99 -0
- vibehub-1.0.0/src/Vibe/client.py +134 -0
- vibehub-1.0.0/src/Vibe/config.py +67 -0
- vibehub-1.0.0/src/Vibe/doctor.py +79 -0
- vibehub-1.0.0/src/Vibe/errors.py +37 -0
- vibehub-1.0.0/src/Vibe/filters.py +73 -0
- vibehub-1.0.0/src/Vibe/formatting.py +164 -0
- vibehub-1.0.0/src/Vibe/fsm.py +103 -0
- vibehub-1.0.0/src/Vibe/keyboard.py +67 -0
- vibehub-1.0.0/src/Vibe/limits.py +58 -0
- vibehub-1.0.0/src/Vibe/middleware.py +52 -0
- vibehub-1.0.0/src/Vibe/models.py +255 -0
- vibehub-1.0.0/src/Vibe/py.typed +0 -0
- vibehub-1.0.0/src/Vibe/servers.py +87 -0
- vibehub-1.0.0/src/Vibe/util.py +12 -0
- vibehub-1.0.0/src/vibehub.egg-info/PKG-INFO +73 -0
- vibehub-1.0.0/src/vibehub.egg-info/SOURCES.txt +28 -0
- vibehub-1.0.0/src/vibehub.egg-info/dependency_links.txt +1 -0
- vibehub-1.0.0/src/vibehub.egg-info/entry_points.txt +2 -0
- vibehub-1.0.0/src/vibehub.egg-info/requires.txt +1 -0
- vibehub-1.0.0/src/vibehub.egg-info/top_level.txt +1 -0
vibehub-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MrLunarDev
|
|
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.
|
vibehub-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vibehub
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Small Python library for building Vibegram bots (import name: Vibe)
|
|
5
|
+
Author: MrLunarDev
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/VibeHub-ML
|
|
8
|
+
Keywords: vibegram,bot,chatbot,messenger
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Typing :: Typed
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: requests>=2.25
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# VibeHub
|
|
21
|
+
|
|
22
|
+
Small Python library for building **Vibegram** bots. `import Vibe`, then `Vibe.Bot("TOKEN")`.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install vibehub # Python 3.8+, only dependency: requests
|
|
26
|
+
vibehub new mybot # scaffold a project
|
|
27
|
+
cd mybot && export VIBE_TOKEN=... && python bot.py
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
import Vibe
|
|
32
|
+
from Vibe import Filters
|
|
33
|
+
|
|
34
|
+
bot = Vibe.Bot("TOKEN")
|
|
35
|
+
|
|
36
|
+
@bot.command("start", "Start the bot")
|
|
37
|
+
def start(message):
|
|
38
|
+
message.reply("Hello!")
|
|
39
|
+
|
|
40
|
+
@bot.on_message(Filters.text & ~Filters.command)
|
|
41
|
+
def echo(message):
|
|
42
|
+
message.reply(message.text)
|
|
43
|
+
|
|
44
|
+
bot.run() # Ctrl+C to stop
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## What is inside
|
|
48
|
+
|
|
49
|
+
Long polling and webhook · commands, filters, handlers (message, edited, channel post, callback, join/leave) ·
|
|
50
|
+
inline and reply keyboards · `Markdown` / `HTML` helpers · media upload · group admin calls ·
|
|
51
|
+
FSM conversations · middleware (`Logging`, `Recovery`, `AntiFlood`) · `vibehub new` and `vibehub check`.
|
|
52
|
+
|
|
53
|
+
Guide: `docs/guide.md`. Examples: `examples/`.
|
|
54
|
+
|
|
55
|
+
## The API is a guess
|
|
56
|
+
|
|
57
|
+
The Vibegram Bot API docs were not available when this was written, so everything about the server is a best guess
|
|
58
|
+
and lives in `src/Vibe/config.py` (`ApiConfig`): base URL, token placement, method names,
|
|
59
|
+
webhook secret header and reply style. `vibehub check` (with `VIBE_TOKEN` set) tries the guessed ways of calling
|
|
60
|
+
the API and tells you what to change. It never prints the token.
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
cfg = Vibe.ApiConfig(token_in_path=False) # token in "Authorization: Bearer ..."
|
|
64
|
+
bot = Vibe.Bot("TOKEN", config=cfg)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Tests
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
python -m unittest discover -s tests # offline, includes a local HTTP round-trip
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
MIT licensed.
|
vibehub-1.0.0/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# VibeHub
|
|
2
|
+
|
|
3
|
+
Small Python library for building **Vibegram** bots. `import Vibe`, then `Vibe.Bot("TOKEN")`.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install vibehub # Python 3.8+, only dependency: requests
|
|
7
|
+
vibehub new mybot # scaffold a project
|
|
8
|
+
cd mybot && export VIBE_TOKEN=... && python bot.py
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
import Vibe
|
|
13
|
+
from Vibe import Filters
|
|
14
|
+
|
|
15
|
+
bot = Vibe.Bot("TOKEN")
|
|
16
|
+
|
|
17
|
+
@bot.command("start", "Start the bot")
|
|
18
|
+
def start(message):
|
|
19
|
+
message.reply("Hello!")
|
|
20
|
+
|
|
21
|
+
@bot.on_message(Filters.text & ~Filters.command)
|
|
22
|
+
def echo(message):
|
|
23
|
+
message.reply(message.text)
|
|
24
|
+
|
|
25
|
+
bot.run() # Ctrl+C to stop
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## What is inside
|
|
29
|
+
|
|
30
|
+
Long polling and webhook · commands, filters, handlers (message, edited, channel post, callback, join/leave) ·
|
|
31
|
+
inline and reply keyboards · `Markdown` / `HTML` helpers · media upload · group admin calls ·
|
|
32
|
+
FSM conversations · middleware (`Logging`, `Recovery`, `AntiFlood`) · `vibehub new` and `vibehub check`.
|
|
33
|
+
|
|
34
|
+
Guide: `docs/guide.md`. Examples: `examples/`.
|
|
35
|
+
|
|
36
|
+
## The API is a guess
|
|
37
|
+
|
|
38
|
+
The Vibegram Bot API docs were not available when this was written, so everything about the server is a best guess
|
|
39
|
+
and lives in `src/Vibe/config.py` (`ApiConfig`): base URL, token placement, method names,
|
|
40
|
+
webhook secret header and reply style. `vibehub check` (with `VIBE_TOKEN` set) tries the guessed ways of calling
|
|
41
|
+
the API and tells you what to change. It never prints the token.
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
cfg = Vibe.ApiConfig(token_in_path=False) # token in "Authorization: Bearer ..."
|
|
45
|
+
bot = Vibe.Bot("TOKEN", config=cfg)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Tests
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python -m unittest discover -s tests # offline, includes a local HTTP round-trip
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
MIT licensed.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vibehub"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Small Python library for building Vibegram bots (import name: Vibe)"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "MrLunarDev" }]
|
|
13
|
+
keywords = ["vibegram", "bot", "chatbot", "messenger"]
|
|
14
|
+
dependencies = ["requests>=2.25"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Typing :: Typed",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Homepage = "https://github.com/VibeHub-ML"
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
vibehub = "Vibe.cli:main"
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.packages.find]
|
|
30
|
+
where = ["src"]
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.package-data]
|
|
33
|
+
Vibe = ["py.typed"]
|
vibehub-1.0.0/setup.cfg
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from .bot import Bot
|
|
2
|
+
from .config import ApiConfig, DEFAULT_BASE_URL, DEFAULT_METHODS
|
|
3
|
+
from .errors import (APIError, AuthError, HandlerError, NetworkError, RateLimitError, ValidationError,
|
|
4
|
+
VibeError)
|
|
5
|
+
from .filters import Filter, Filters
|
|
6
|
+
from .formatting import HTML, Markdown, Markup
|
|
7
|
+
from .fsm import Conversation, ConversationManager, State
|
|
8
|
+
from .keyboard import Button, InlineKeyboard, ReplyKeyboard, remove_keyboard
|
|
9
|
+
from .limits import Cooldown, RateLimit
|
|
10
|
+
from .middleware import AntiFlood, BaseMiddleware, Logging, Recovery
|
|
11
|
+
from .models import (CallbackQuery, Chat, ChatMember, ChatMemberUpdated, Document, Message, Photo, Update,
|
|
12
|
+
User)
|
|
13
|
+
|
|
14
|
+
__version__ = "1.0.0"
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"Bot", "ApiConfig", "DEFAULT_BASE_URL", "DEFAULT_METHODS",
|
|
18
|
+
"VibeError", "APIError", "AuthError", "RateLimitError", "NetworkError", "ValidationError", "HandlerError",
|
|
19
|
+
"Filter", "Filters", "Markdown", "HTML", "Markup", "Button", "InlineKeyboard", "ReplyKeyboard", "remove_keyboard",
|
|
20
|
+
"BaseMiddleware", "Logging", "Recovery", "AntiFlood", "Cooldown", "RateLimit",
|
|
21
|
+
"Conversation", "ConversationManager", "State",
|
|
22
|
+
"CallbackQuery", "Chat", "ChatMember", "ChatMemberUpdated", "Document", "Message", "Photo", "Update", "User",
|
|
23
|
+
]
|