funpaybotengine 0.1.1.dev1__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.
- funpaybotengine-0.1.1.dev1/.env +8 -0
- funpaybotengine-0.1.1.dev1/.github/CODEOWNERS +1 -0
- funpaybotengine-0.1.1.dev1/.gitignore +20 -0
- funpaybotengine-0.1.1.dev1/PKG-INFO +32 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/__init__.py +19 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/base.py +64 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/client/__init__.py +4 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/client/bot.py +860 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/client/session/__init__.py +5 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/client/session/aiohttp_session.py +183 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/client/session/base.py +112 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/client/session/http_methods.py +18 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/__init__.py +6 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/events/__init__.py +4 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/events/base.py +52 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/events/builtin_events.py +198 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/filters/__init__.py +5 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/filters/base.py +12 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/filters/message_filters.py +86 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/filters/order_filters.py +53 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/handlers/__init__.py +3 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/handlers/handler_manager.py +56 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/routers/__init__.py +4 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/routers/base.py +76 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/dispatching/routers/dispatcher.py +27 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/exceptions/__init__.py +8 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/exceptions/action_exceptions.py +30 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/exceptions/base.py +11 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/exceptions/bot_exceptions.py +46 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/exceptions/message_check_errors.py +38 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/exceptions/runner_exceptions.py +26 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/exceptions/session_exceptions.py +79 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/loggers.py +13 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/__init__.py +30 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/base.py +230 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/calc_chips.py +41 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/calc_lots.py +44 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/check_banned.py +38 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/delete_review.py +52 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_2fa_status.py +38 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_chat_history.py +90 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_chat_page.py +45 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_main_page.py +44 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_offer_fields.py +53 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_order_page.py +35 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_profile_page.py +37 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_purchases.py +103 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_reviews.py +53 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_sales.py +110 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_settings_page.py +28 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_subcategory_page.py +42 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_telegram_connect_url.py +34 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/get_transactions.py +57 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/logout.py +43 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/raise_offers.py +82 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/refund.py +59 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/review.py +68 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/runner_request.py +80 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/save_offer_fields.py +45 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/set_offers_hidden.py +50 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/update_notice_channel.py +50 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/upload_avatar.py +42 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/methods/upload_image.py +47 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/runner/__init__.py +4 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/runner/config.py +49 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/runner/event_collector.py +412 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/runner/runner.py +100 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/storage/__init__.py +4 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/storage/base.py +214 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/storage/inmemory_storage.py +193 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/__init__.py +16 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/base.py +48 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/calc.py +47 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/categories.py +64 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/chat.py +132 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/common.py +156 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/common_page_elements.py +84 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/enums.py +17 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/finances.py +113 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/messages.py +223 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/offers.py +653 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/orders.py +138 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/pages/__init__.py +10 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/pages/base.py +20 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/pages/chat_page.py +23 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/pages/main_page.py +27 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/pages/order_page.py +120 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/pages/profile_page.py +78 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/pages/settings_page.py +18 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/pages/subcategory_page.py +34 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/pages/transactions_page.py +27 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/requests/__init__.py +3 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/requests/runner.py +275 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/reviews.py +128 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/settings.py +26 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/types/updates.py +170 -0
- funpaybotengine-0.1.1.dev1/funpaybotengine/utils.py +111 -0
- funpaybotengine-0.1.1.dev1/pyproject.toml +125 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
PROXY=socks5://user148430o3869r670825:dgej93@pool.proxys.io:10851
|
|
2
|
+
GOLDEN_KEY=ub4ui4fyjyukbovprql1hgdhzzf9ow8u
|
|
3
|
+
|
|
4
|
+
GOLDEN_KEY2=1ehxhs07yjocv1uchhjfqr98ydzuenpq
|
|
5
|
+
PROXY2=socks5://user148430o7342r250433:dgej93@pool.proxys.io:10699
|
|
6
|
+
|
|
7
|
+
PROXY_MAIN=socks5://user148429:dgej93@45.39.104.142:19392
|
|
8
|
+
GOLDEN_KEY_MAIN=js65bi9hojgguh8q7jb8f48wdhx0mmaq
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @qvvonk
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: funpaybotengine
|
|
3
|
+
Version: 0.1.1.dev1
|
|
4
|
+
Summary: Framework for creating FunPay bots.
|
|
5
|
+
Project-URL: Telegram Channel, https://t.me/funpay_hub
|
|
6
|
+
Project-URL: Repository, https://github.com/funpayhub/funpaybotengine
|
|
7
|
+
Project-URL: Issues, https://github.com/funpyahub/funpaybotengine/issues
|
|
8
|
+
Author-email: Qvvonk <qvvonk@gmail.com>
|
|
9
|
+
Maintainer-email: Qvvonk <qvvonk@gmail.com>
|
|
10
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Requires-Dist: aiohttp-socks~=0.10.1
|
|
19
|
+
Requires-Dist: aiohttp~=3.12.14
|
|
20
|
+
Requires-Dist: eventry~=0.2.0
|
|
21
|
+
Requires-Dist: funpayparsers~=0.5.6
|
|
22
|
+
Requires-Dist: pydantic~=2.11.7
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: mypy>=1.17.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
26
|
+
Provides-Extra: docs
|
|
27
|
+
Requires-Dist: pydata-sphinx-theme>=0.16.1; extra == 'docs'
|
|
28
|
+
Requires-Dist: sphinx-design>=0.6.1; extra == 'docs'
|
|
29
|
+
Requires-Dist: sphinx>=8.1.3; extra == 'docs'
|
|
30
|
+
Provides-Extra: tests
|
|
31
|
+
Requires-Dist: pytest; extra == 'tests'
|
|
32
|
+
Requires-Dist: pytest-asyncio>=1.1.0; extra == 'tests'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import funpaybotengine.dispatching.events as events
|
|
4
|
+
import funpaybotengine.dispatching.filters as filters
|
|
5
|
+
from funpaybotengine.client.bot import Bot
|
|
6
|
+
from funpaybotengine.client.session import BaseSession, AioHttpSession
|
|
7
|
+
from funpaybotengine.dispatching.routers.base import Router
|
|
8
|
+
from funpaybotengine.dispatching.routers.dispatcher import Dispatcher
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
'Bot',
|
|
13
|
+
'BaseSession',
|
|
14
|
+
'AioHttpSession',
|
|
15
|
+
'Router',
|
|
16
|
+
'Dispatcher',
|
|
17
|
+
'events',
|
|
18
|
+
'filters',
|
|
19
|
+
]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
__all__ = ('BindableObject', 'check_bound')
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
8
|
+
from collections.abc import Callable
|
|
9
|
+
|
|
10
|
+
from pydantic import BaseModel, PrivateAttr
|
|
11
|
+
from typing_extensions import Self
|
|
12
|
+
|
|
13
|
+
from funpaybotengine.exceptions import BotNotBoundError
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from funpaybotengine.client.bot import Bot
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
F = TypeVar('F', bound=Callable[..., Any])
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class BindableObject(BaseModel):
|
|
24
|
+
_bot: Bot | None = PrivateAttr(None)
|
|
25
|
+
|
|
26
|
+
def model_post_init(self, context: dict[Any, Any]) -> None:
|
|
27
|
+
self._bot = context.get('bot') if context else None
|
|
28
|
+
|
|
29
|
+
def as_(self, bot: Bot | None, /) -> Self:
|
|
30
|
+
self.bind_to(bot)
|
|
31
|
+
return self
|
|
32
|
+
|
|
33
|
+
def unbind(self) -> None:
|
|
34
|
+
self._bot = None
|
|
35
|
+
|
|
36
|
+
def bind_to(self, bot: Bot | None, /) -> None:
|
|
37
|
+
self._bot = bot
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def bot(self) -> Bot | None:
|
|
41
|
+
return self._bot
|
|
42
|
+
|
|
43
|
+
def get_bound_bot(self) -> Bot:
|
|
44
|
+
if not self.bot:
|
|
45
|
+
raise BotNotBoundError(self)
|
|
46
|
+
return self.bot
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def check_bound(func: F) -> F:
|
|
50
|
+
"""
|
|
51
|
+
Decorator for instance methods to ensure the object is bound to any Bot instance.
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
def wrapper(*args: Any, **kwargs: Any) -> Any:
|
|
55
|
+
if not args:
|
|
56
|
+
raise RuntimeError('Can be used only with instance methods.')
|
|
57
|
+
|
|
58
|
+
if not isinstance(args[0], BindableObject):
|
|
59
|
+
raise ValueError(f'{args[0].__class__.__name__} is not a bindable object.')
|
|
60
|
+
if args[0].bot is None:
|
|
61
|
+
raise RuntimeError(f'{args[0]} is not bound to any `Bot` instance.')
|
|
62
|
+
return func(*args, **kwargs)
|
|
63
|
+
|
|
64
|
+
return wrapper # type: ignore
|