balebaazoo 1.2.1 → 1.2.3

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.
Files changed (2) hide show
  1. package/README.md +51 -28
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,7 +1,3 @@
1
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vazirmatn@33.0.3/Vazirmatn-font-face.css">
2
-
3
- <div lang="fa" style="font-family: Vazirmatn, Tahoma, sans-serif;">
4
-
5
1
  # balebaazoo
6
2
 
7
3
  SDK مدرن و type-safe برای توسعهٔ بازو (Bot) در پیام‌رسان بله.
@@ -10,21 +6,22 @@ SDK مدرن و type-safe برای توسعهٔ بازو (Bot) در پیام‌
10
6
 
11
7
  بر پایهٔ [مستندات رسمی API بازوی بله](https://docs.bale.ai/) ساخته شده است.
12
8
 
13
- **English:** [README.en.md](README.en.md)
14
-
15
- ## مستندات فارسی
16
-
17
- - **[راهنمای کامل استفاده](docs/fa/usage.md)**
18
- - **[راهنمای انتشار npm](docs/fa/publishing.md)**
9
+ **English:** [README.en.md](README.en.md) · **مستندات فارسی:** [docs/fa/usage.md](docs/fa/usage.md)
19
10
 
20
11
  ## نصب
21
12
 
13
+ <div dir="ltr">
14
+
22
15
  ```bash
23
16
  npm install balebaazoo
24
17
  ```
25
18
 
19
+ </div>
20
+
26
21
  ## شروع سریع
27
22
 
23
+ <div dir="ltr">
24
+
28
25
  ```typescript
29
26
  import { Bot, InlineKeyboard, setupGracefulShutdown } from "balebaazoo";
30
27
 
@@ -49,11 +46,17 @@ void bot.start({
49
46
  });
50
47
  ```
51
48
 
52
- > **نکته:** `bot.start()` تا زمان `bot.stop()` ادامه دارد. برای لاگ بعد از راه‌اندازی از `onStart` استفاده کنید، نه `await` بعد از `start()`.
49
+ </div>
50
+
51
+ <blockquote dir="rtl">
52
+ <p><strong>نکته:</strong> تابع <code dir="ltr">bot.start()</code> تا زمان <code dir="ltr">bot.stop()</code> ادامه دارد. برای لاگ بعد از راه‌اندازی از <code dir="ltr">onStart</code> استفاده کنید، نه <code dir="ltr">await</code> بعد از <code dir="ltr">start()</code>.</p>
53
+ </blockquote>
53
54
 
54
55
  ## TypeScript
55
56
 
56
- پروژهٔ شما باید ESM باشد:
57
+ <p dir="rtl">پروژهٔ شما باید <code dir="ltr">ESM</code> باشد:</p>
58
+
59
+ <div dir="ltr">
57
60
 
58
61
  ```json
59
62
  {
@@ -61,6 +64,10 @@ void bot.start({
61
64
  }
62
65
  ```
63
66
 
67
+ </div>
68
+
69
+ <div dir="ltr">
70
+
64
71
  ```json
65
72
  {
66
73
  "compilerOptions": {
@@ -72,22 +79,30 @@ void bot.start({
72
79
  }
73
80
  ```
74
81
 
75
- قالب آماده: [`templates/starter`](templates/starter)
82
+ </div>
83
+
84
+ <p dir="rtl">قالب آماده: <a href="templates/starter"><code dir="ltr">templates/starter</code></a></p>
76
85
 
77
86
  ### خطای TS1295
78
87
 
79
- اگر `ECMAScript imports and exports cannot be written in a CommonJS file` دیدید، `"type": "module"` را به `package.json` اضافه کنید.
88
+ <p dir="rtl">اگر خطای <code dir="ltr">ECMAScript imports and exports cannot be written in a CommonJS file</code> دیدید، <code dir="ltr">"type": "module"</code> را به <code dir="ltr">package.json</code> اضافه کنید.</p>
80
89
 
81
- ### خطای TS2322 با `ctx.reply()`
90
+ ### خطای TS2322 با ctx.reply
82
91
 
83
- نسخهٔ `1.0.1+` اجازه می‌دهد handler مستقیماً `ctx.reply()` را return کند:
92
+ <p dir="rtl">نسخهٔ <code dir="ltr">1.0.1+</code> اجازه می‌دهد handler مستقیماً <code dir="ltr">ctx.reply()</code> را return کند:</p>
93
+
94
+ <div dir="ltr">
84
95
 
85
96
  ```typescript
86
97
  bot.command("start", (ctx) => ctx.reply("سلام!"));
87
98
  ```
88
99
 
100
+ </div>
101
+
89
102
  ### nodemon + TypeScript
90
103
 
104
+ <div dir="ltr">
105
+
91
106
  ```json
92
107
  {
93
108
  "watch": ["src"],
@@ -96,32 +111,40 @@ bot.command("start", (ctx) => ctx.reply("سلام!"));
96
111
  }
97
112
  ```
98
113
 
114
+ </div>
115
+
99
116
  ## ویژگی‌ها
100
117
 
101
- - **Type-safe** — تایپ‌های کامل TypeScript
102
- - **Middleware** `Composer`، `bot.catch()`، `errorHandler`
103
- - **Lifecycle** `onStart`، `setupGracefulShutdown`، `dropPendingUpdates`، `launch()`
104
- - **Polling و Webhook** long polling با AbortSignal و webhook handler
105
- - **Bale-native**`askReview`، `inquireTransaction`، کیف‌پول
106
- - **بدون dependency** Node.js 18+
118
+ <ul dir="rtl">
119
+ <li><strong>Type-safe</strong>تایپ‌های کامل TypeScript</li>
120
+ <li><strong>Middleware</strong><code dir="ltr">Composer</code>، <code dir="ltr">bot.catch()</code>، <code dir="ltr">errorHandler</code></li>
121
+ <li><strong>Lifecycle</strong> <code dir="ltr">onStart</code>، <code dir="ltr">setupGracefulShutdown</code>، <code dir="ltr">dropPendingUpdates</code>، <code dir="ltr">launch()</code></li>
122
+ <li><strong>Polling و Webhook</strong> long polling با AbortSignal و webhook handler</li>
123
+ <li><strong>Bale-native</strong> <code dir="ltr">askReview</code>، <code dir="ltr">inquireTransaction</code>، کیف‌پول</li>
124
+ <li><strong>بدون dependency</strong> — Node.js 18+</li>
125
+ </ul>
107
126
 
108
127
  ## مثال‌ها
109
128
 
110
- - [`examples/echo-bot.ts`](examples/echo-bot.ts)
111
- - [`examples/inline-keyboard.ts`](examples/inline-keyboard.ts)
112
- - [`examples/payment-bot.ts`](examples/payment-bot.ts)
113
- - [`examples/webhook-server.ts`](examples/webhook-server.ts)
129
+ <ul dir="rtl">
130
+ <li><a href="examples/echo-bot.ts"><code dir="ltr">examples/echo-bot.ts</code></a></li>
131
+ <li><a href="examples/inline-keyboard.ts"><code dir="ltr">examples/inline-keyboard.ts</code></a></li>
132
+ <li><a href="examples/payment-bot.ts"><code dir="ltr">examples/payment-bot.ts</code></a></li>
133
+ <li><a href="examples/webhook-server.ts"><code dir="ltr">examples/webhook-server.ts</code></a></li>
134
+ </ul>
114
135
 
115
136
  ## توسعه
116
137
 
138
+ <div dir="ltr">
139
+
117
140
  ```bash
118
141
  npm install
119
142
  npm run build
120
143
  npm test
121
144
  ```
122
145
 
146
+ </div>
147
+
123
148
  ## لایسنس
124
149
 
125
150
  GPL-3.0-or-later
126
-
127
- </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "balebaazoo",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "A modern, type-safe SDK for Bale Bot API",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Hadi Mardanian",