pyrobale 0.2.2__tar.gz → 0.2.8__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.
- {pyrobale-0.2.2 → pyrobale-0.2.8}/LICENSE +5 -1
- {pyrobale-0.2.2 → pyrobale-0.2.8}/PKG-INFO +36 -29
- {pyrobale-0.2.2 → pyrobale-0.2.8}/README.md +30 -27
- {pyrobale-0.2.2 → pyrobale-0.2.8}/pyproject.toml +3 -3
- pyrobale-0.2.8/pyrobale.png +0 -0
- pyrobale-0.2.8/pyrobale.py +2269 -0
- pyrobale-0.2.8/pyrobaletext.png +0 -0
- pyrobale-0.2.2/pyrobale.py +0 -1422
@@ -671,4 +671,8 @@ into proprietary programs. If your program is a subroutine library, you
|
|
671
671
|
may consider it more useful to permit linking proprietary applications with
|
672
672
|
the library. If this is what you want to do, use the GNU Lesser General
|
673
673
|
Public License instead of this License. But first, please read
|
674
|
-
|
674
|
+
<<<<<<< HEAD
|
675
|
+
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
676
|
+
=======
|
677
|
+
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
678
|
+
>>>>>>> a5043d5a348e3fb8d7f8faf92c8a566bc05b9d84
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pyrobale
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.8
|
4
4
|
Summary: A python wrapper for bale api
|
5
5
|
Project-URL: github, https://github.com/pyrobale/pyrobale
|
6
6
|
Project-URL: website, https://pyrobale.github.io
|
@@ -678,12 +678,16 @@ License: GNU GENERAL PUBLIC LICENSE
|
|
678
678
|
may consider it more useful to permit linking proprietary applications with
|
679
679
|
the library. If this is what you want to do, use the GNU Lesser General
|
680
680
|
Public License instead of this License. But first, please read
|
681
|
+
<<<<<<< HEAD
|
681
682
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
683
|
+
=======
|
684
|
+
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
685
|
+
>>>>>>> a5043d5a348e3fb8d7f8faf92c8a566bc05b9d84
|
682
686
|
License-File: LICENSE
|
683
687
|
Classifier: License :: OSI Approved :: MIT License
|
684
688
|
Classifier: Operating System :: OS Independent
|
685
689
|
Classifier: Programming Language :: Python :: 3
|
686
|
-
Requires-Python: >=3.
|
690
|
+
Requires-Python: >=3.9
|
687
691
|
Description-Content-Type: text/markdown
|
688
692
|
|
689
693
|

|
@@ -715,13 +719,11 @@ A Python wrapper for the Bale Bot API that makes it easy to build Bale bots.
|
|
715
719
|
|
716
720
|
## Installation
|
717
721
|
|
718
|
-
|
719
|
-
pip install pyrobale
|
720
|
-
|
722
|
+
``pip install pyrobale``
|
721
723
|
|
722
724
|
## Quick Start
|
723
725
|
|
724
|
-
|
726
|
+
```py
|
725
727
|
from bale import Client, MenuKeyboardMarkup, MenuKeyboardButton
|
726
728
|
|
727
729
|
# Initialize bot with token
|
@@ -734,93 +736,98 @@ def handle_message(message):
|
|
734
736
|
# Create keyboard
|
735
737
|
keyboard = MenuKeyboardMarkup()
|
736
738
|
keyboard.add(MenuKeyboardButton("Hello!"))
|
737
|
-
|
739
|
+
|
738
740
|
# Send welcome message
|
739
741
|
message.reply_message("Welcome!", reply_markup=keyboard)
|
740
742
|
|
741
743
|
# Start the bot
|
742
744
|
bot.run()
|
743
|
-
|
745
|
+
```
|
744
746
|
|
745
747
|
## Key Components
|
746
748
|
|
747
749
|
### Client
|
750
|
+
|
748
751
|
The main class for interacting with Bale API. Handles all API requests and provides event decorators.
|
749
752
|
|
750
753
|
### Message
|
754
|
+
|
751
755
|
Represents a message in Bale with methods for replying, editing, and deleting messages.
|
752
756
|
|
753
757
|
### User
|
758
|
+
|
754
759
|
Represents a Bale user with their properties and methods.
|
755
760
|
|
756
761
|
### Chat
|
762
|
+
|
757
763
|
Represents a chat conversation with methods for sending messages and managing chat settings.
|
758
764
|
|
759
765
|
### Keyboards
|
766
|
+
|
760
767
|
- `MenuKeyboardMarkup`: For creating text keyboards
|
761
768
|
- `InlineKeyboardMarkup`: For creating inline keyboards
|
762
769
|
|
763
770
|
### Database
|
771
|
+
|
764
772
|
Built-in SQLite database support for storing persistent data.
|
765
773
|
|
766
774
|
## Event Handlers
|
767
775
|
|
768
|
-
|
769
776
|
# Message handler
|
777
|
+
|
778
|
+
```python
|
770
779
|
@bot.on_message
|
771
780
|
def handle_message(message):
|
772
781
|
pass
|
782
|
+
```
|
773
783
|
|
774
784
|
# Callback query handler
|
785
|
+
|
786
|
+
```python
|
775
787
|
@bot.on_callback_query
|
776
788
|
def handle_callback(callback):
|
777
789
|
pass
|
790
|
+
```
|
778
791
|
|
779
792
|
# Periodic task handler
|
793
|
+
|
794
|
+
```python
|
780
795
|
@bot.on_tick(60) # Runs every 60 seconds
|
781
796
|
def handle_tick():
|
782
797
|
pass
|
798
|
+
```
|
783
799
|
|
784
800
|
# Ready event handler
|
801
|
+
|
802
|
+
```python
|
785
803
|
@bot.on_ready
|
786
804
|
def handle_ready():
|
787
805
|
pass
|
806
|
+
```
|
788
807
|
|
789
808
|
# Member join handler
|
809
|
+
|
810
|
+
```python
|
790
811
|
@bot.on_member_chat_join
|
791
812
|
def handle_join(message, chat, user):
|
792
813
|
pass
|
814
|
+
```
|
793
815
|
|
794
816
|
# Member leave handler
|
817
|
+
|
818
|
+
```python
|
795
819
|
@bot.on_member_chat_leave
|
796
820
|
def handle_leave(message, chat, user):
|
797
821
|
pass
|
798
|
-
|
822
|
+
```
|
799
823
|
|
800
824
|
## Database Usage
|
801
825
|
|
802
|
-
|
803
826
|
# Access database
|
827
|
+
|
804
828
|
```py
|
805
829
|
with bot.database as db:
|
806
830
|
db.write_key("user_123", {"points": 100})
|
807
|
-
|
831
|
+
|
808
832
|
data = db.read_key("user_123")
|
809
833
|
```
|
810
|
-
|
811
|
-
|
812
|
-
## Running Multiple Bots
|
813
|
-
|
814
|
-
|
815
|
-
```py
|
816
|
-
from bale import run_multiple_clients
|
817
|
-
|
818
|
-
bot1 = Client("TOKEN1")
|
819
|
-
bot2 = Client("TOKEN2")
|
820
|
-
|
821
|
-
run_multiple_clients(bot1, bot2)```
|
822
|
-
|
823
|
-
|
824
|
-
## License
|
825
|
-
|
826
|
-
This project is licensed under the MIT License - see the LICENSE file for details.
|
@@ -27,13 +27,11 @@ A Python wrapper for the Bale Bot API that makes it easy to build Bale bots.
|
|
27
27
|
|
28
28
|
## Installation
|
29
29
|
|
30
|
-
|
31
|
-
pip install pyrobale
|
32
|
-
|
30
|
+
``pip install pyrobale``
|
33
31
|
|
34
32
|
## Quick Start
|
35
33
|
|
36
|
-
|
34
|
+
```py
|
37
35
|
from bale import Client, MenuKeyboardMarkup, MenuKeyboardButton
|
38
36
|
|
39
37
|
# Initialize bot with token
|
@@ -46,93 +44,98 @@ def handle_message(message):
|
|
46
44
|
# Create keyboard
|
47
45
|
keyboard = MenuKeyboardMarkup()
|
48
46
|
keyboard.add(MenuKeyboardButton("Hello!"))
|
49
|
-
|
47
|
+
|
50
48
|
# Send welcome message
|
51
49
|
message.reply_message("Welcome!", reply_markup=keyboard)
|
52
50
|
|
53
51
|
# Start the bot
|
54
52
|
bot.run()
|
55
|
-
|
53
|
+
```
|
56
54
|
|
57
55
|
## Key Components
|
58
56
|
|
59
57
|
### Client
|
58
|
+
|
60
59
|
The main class for interacting with Bale API. Handles all API requests and provides event decorators.
|
61
60
|
|
62
61
|
### Message
|
62
|
+
|
63
63
|
Represents a message in Bale with methods for replying, editing, and deleting messages.
|
64
64
|
|
65
65
|
### User
|
66
|
+
|
66
67
|
Represents a Bale user with their properties and methods.
|
67
68
|
|
68
69
|
### Chat
|
70
|
+
|
69
71
|
Represents a chat conversation with methods for sending messages and managing chat settings.
|
70
72
|
|
71
73
|
### Keyboards
|
74
|
+
|
72
75
|
- `MenuKeyboardMarkup`: For creating text keyboards
|
73
76
|
- `InlineKeyboardMarkup`: For creating inline keyboards
|
74
77
|
|
75
78
|
### Database
|
79
|
+
|
76
80
|
Built-in SQLite database support for storing persistent data.
|
77
81
|
|
78
82
|
## Event Handlers
|
79
83
|
|
80
|
-
|
81
84
|
# Message handler
|
85
|
+
|
86
|
+
```python
|
82
87
|
@bot.on_message
|
83
88
|
def handle_message(message):
|
84
89
|
pass
|
90
|
+
```
|
85
91
|
|
86
92
|
# Callback query handler
|
93
|
+
|
94
|
+
```python
|
87
95
|
@bot.on_callback_query
|
88
96
|
def handle_callback(callback):
|
89
97
|
pass
|
98
|
+
```
|
90
99
|
|
91
100
|
# Periodic task handler
|
101
|
+
|
102
|
+
```python
|
92
103
|
@bot.on_tick(60) # Runs every 60 seconds
|
93
104
|
def handle_tick():
|
94
105
|
pass
|
106
|
+
```
|
95
107
|
|
96
108
|
# Ready event handler
|
109
|
+
|
110
|
+
```python
|
97
111
|
@bot.on_ready
|
98
112
|
def handle_ready():
|
99
113
|
pass
|
114
|
+
```
|
100
115
|
|
101
116
|
# Member join handler
|
117
|
+
|
118
|
+
```python
|
102
119
|
@bot.on_member_chat_join
|
103
120
|
def handle_join(message, chat, user):
|
104
121
|
pass
|
122
|
+
```
|
105
123
|
|
106
124
|
# Member leave handler
|
125
|
+
|
126
|
+
```python
|
107
127
|
@bot.on_member_chat_leave
|
108
128
|
def handle_leave(message, chat, user):
|
109
129
|
pass
|
110
|
-
|
130
|
+
```
|
111
131
|
|
112
132
|
## Database Usage
|
113
133
|
|
114
|
-
|
115
134
|
# Access database
|
135
|
+
|
116
136
|
```py
|
117
137
|
with bot.database as db:
|
118
138
|
db.write_key("user_123", {"points": 100})
|
119
|
-
|
139
|
+
|
120
140
|
data = db.read_key("user_123")
|
121
141
|
```
|
122
|
-
|
123
|
-
|
124
|
-
## Running Multiple Bots
|
125
|
-
|
126
|
-
|
127
|
-
```py
|
128
|
-
from bale import run_multiple_clients
|
129
|
-
|
130
|
-
bot1 = Client("TOKEN1")
|
131
|
-
bot2 = Client("TOKEN2")
|
132
|
-
|
133
|
-
run_multiple_clients(bot1, bot2)```
|
134
|
-
|
135
|
-
|
136
|
-
## License
|
137
|
-
|
138
|
-
This project is licensed under the MIT License - see the LICENSE file for details.
|
@@ -1,12 +1,12 @@
|
|
1
1
|
[project]
|
2
2
|
name = "pyrobale"
|
3
|
-
version = "0.2.
|
3
|
+
version = "0.2.8"
|
4
4
|
authors = [
|
5
5
|
{ name = "Ali Safamanesh", email = "darg.q.a.a@gmail.com" },
|
6
6
|
]
|
7
7
|
description = "A python wrapper for bale api"
|
8
8
|
readme = "README.md"
|
9
|
-
requires-python = ">=3.
|
9
|
+
requires-python = ">=3.9"
|
10
10
|
classifiers = [
|
11
11
|
"Programming Language :: Python :: 3",
|
12
12
|
"License :: OSI Approved :: MIT License",
|
@@ -20,4 +20,4 @@ website = "https://pyrobale.github.io"
|
|
20
20
|
|
21
21
|
[build-system]
|
22
22
|
requires = ["hatchling"]
|
23
|
-
build-backend = "hatchling.build"
|
23
|
+
build-backend = "hatchling.build"
|
Binary file
|