balebaazoo 1.2.2 → 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.
- package/README.md +22 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,11 +48,13 @@ void bot.start({
|
|
|
48
48
|
|
|
49
49
|
</div>
|
|
50
50
|
|
|
51
|
-
>
|
|
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>
|
|
52
54
|
|
|
53
55
|
## TypeScript
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
<p dir="rtl">پروژهٔ شما باید <code dir="ltr">ESM</code> باشد:</p>
|
|
56
58
|
|
|
57
59
|
<div dir="ltr">
|
|
58
60
|
|
|
@@ -79,15 +81,15 @@ void bot.start({
|
|
|
79
81
|
|
|
80
82
|
</div>
|
|
81
83
|
|
|
82
|
-
|
|
84
|
+
<p dir="rtl">قالب آماده: <a href="templates/starter"><code dir="ltr">templates/starter</code></a></p>
|
|
83
85
|
|
|
84
86
|
### خطای TS1295
|
|
85
87
|
|
|
86
|
-
|
|
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>
|
|
87
89
|
|
|
88
|
-
### خطای TS2322 با
|
|
90
|
+
### خطای TS2322 با ctx.reply
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
<p dir="rtl">نسخهٔ <code dir="ltr">1.0.1+</code> اجازه میدهد handler مستقیماً <code dir="ltr">ctx.reply()</code> را return کند:</p>
|
|
91
93
|
|
|
92
94
|
<div dir="ltr">
|
|
93
95
|
|
|
@@ -113,19 +115,23 @@ bot.command("start", (ctx) => ctx.reply("سلام!"));
|
|
|
113
115
|
|
|
114
116
|
## ویژگیها
|
|
115
117
|
|
|
116
|
-
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
-
|
|
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>
|
|
122
126
|
|
|
123
127
|
## مثالها
|
|
124
128
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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>
|
|
129
135
|
|
|
130
136
|
## توسعه
|
|
131
137
|
|