vnai 2.1.7__py3-none-any.whl → 2.1.9__py3-none-any.whl

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.
vnai/scope/promo.py CHANGED
@@ -1,278 +1,293 @@
1
- import logging
2
- import requests
3
- from datetime import datetime
4
- import random
5
- import threading
6
- import time
7
- import urllib.parse
8
- _vnii_check_attempted = False
9
-
10
- class AdCategory:
11
- FREE = 0
12
- MANDATORY = 1
13
- ANNOUNCEMENT = 2
14
- REFERRAL = 3
15
- FEATURE = 4
16
- GUIDE = 5
17
- SURVEY = 6
18
- PROMOTION = 7
19
- SECURITY = 8
20
- MAINTENANCE = 9
21
- WARNING = 10
22
- try:
23
- from vnii import lc_init
24
- except ImportError:
25
- lc_init = None
26
- logger = logging.getLogger(__name__)
27
- if not logger.hasHandlers():
28
- handler = logging.StreamHandler()
29
- handler.setFormatter(logging.Formatter('%(message)s'))
30
- logger.addHandler(handler)
31
- logger.setLevel(logging.ERROR)
32
-
33
- class ContentManager:
34
- _instance = None
35
- _lock = threading.Lock()
36
-
37
- def __new__(cls):
38
- with cls._lock:
39
- if cls._instance is None:
40
- cls._instance = super(ContentManager, cls).__new__(cls)
41
- cls._instance._initialize()
42
- return cls._instance
43
-
44
- def _initialize(self):
45
- self.content_base_url ="https://hq.vnstocks.com/content-delivery"
46
- global _vnii_check_attempted
47
- if _vnii_check_attempted:
48
- return
49
- _vnii_check_attempted = True
50
- import sys
51
- import importlib
52
- try:
53
- import importlib.metadata
54
- VNII_LATEST_VERSION ="0.0.9"
55
- VNII_URL =f"https://github.com/vnstock-hq/licensing/releases/download/vnii-{VNII_LATEST_VERSION}/vnii-{VNII_LATEST_VERSION}.tar.gz"
56
- import subprocess
57
- try:
58
- old_version = importlib.metadata.version("vnii")
59
- if old_version != VNII_LATEST_VERSION:
60
- try:
61
- subprocess.check_call([
62
- sys.executable,"-m","pip","install",f"vnii@{VNII_URL}","--quiet"
63
- ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
64
- importlib.invalidate_caches()
65
- if"vnii" in sys.modules:
66
- importlib.reload(sys.modules["vnii"])
67
- else:
68
- import vnii
69
- new_version = importlib.metadata.version("vnii")
70
- except Exception as e:
71
- logger.error(f"Lỗi khi cài đặt vnii: {e}")
72
- pass
73
- except importlib.metadata.PackageNotFoundError:
74
- self.is_paid_user = False
75
- return
76
- except Exception as e:
77
- logger.error(f"Lỗi khi kiểm tra/cài đặt vnii: {e}")
78
- user_msg = (
79
- "Không thể tự động cài đặt/cập nhật vnii. "
80
- "Vui lòng liên hệ admin hoặc hỗ trợ kỹ thuật của Vnstock để được trợ giúp. "
81
- f"Chi tiết lỗi: {e}"
82
- )
83
- logger.error(user_msg)
84
- try:
85
- print(user_msg)
86
- except Exception:
87
- pass
88
- self.is_paid_user = False
89
- return
90
- self.is_paid_user = False
91
- if lc_init is not None:
92
- try:
93
- license_info = lc_init(repo_name='vnstock')
94
- status = license_info.get('status','').lower()
95
- if'recognized and verified' in status:
96
- self.is_paid_user = True
97
- except Exception as e:
98
- pass
99
- else:
100
- pass
101
- self.last_display = 0
102
- self.display_interval = 24 * 3600
103
- self.content_base_url ="https://hq.vnstocks.com/content-delivery"
104
- self.target_url ="https://vnstocks.com/lp-khoa-hoc-python-chung-khoan"
105
- self.image_url = (
106
- "https://vnstocks.com/img/trang-chu-vnstock-python-api-phan-tich-giao-dich-chung-khoan.jpg"
107
- )
108
- self._start_periodic_display()
109
-
110
- def _start_periodic_display(self):
111
- def periodic_display():
112
- while True:
113
- if self.is_paid_user:
114
- break
115
- sleep_time = random.randint(2 * 3600, 6 * 3600)
116
- time.sleep(sleep_time)
117
- current_time = time.time()
118
- if current_time - self.last_display >= self.display_interval:
119
- self.present_content(context="periodic")
120
- else:
121
- pass
122
- thread = threading.Thread(target=periodic_display, daemon=True)
123
- thread.start()
124
-
125
- def fetch_remote_content(self, context: str ="init", html: bool = True) -> str:
126
- if self.is_paid_user:
127
- return""
128
- """
129
- Fetch promotional content from remote service with context and format flag.
130
- Args:
131
- context: usage context (e.g., "init", "periodic", "loop").
132
- html: if True, request HTML; otherwise plain text.
133
- Returns:
134
- The content string on HTTP 200, or None on failure.
135
- """
136
- try:
137
- params = {"context": context,"html":"true" if html else"false"}
138
- url =f"{self.content_base_url}?{urllib.parse.urlencode(params)}"
139
- response = requests.get(url, timeout=3)
140
- if response.status_code == 200:
141
- return response.text
142
- logger.error(f"Non-200 response fetching content: {response.status_code}")
143
- return None
144
- except Exception as e:
145
- logger.error(f"Failed to fetch remote content: {e}")
146
- return None
147
-
148
- def present_content(self, context: str ="init", ad_category: int = AdCategory.FREE) -> None:
149
- environment = None
150
- if getattr(self,'is_paid_user', False) and ad_category == AdCategory.FREE:
151
- return
152
- self.last_display = time.time()
153
- if environment is None:
154
- try:
155
- from vnai.scope.profile import inspector
156
- environment = inspector.examine().get("environment","unknown")
157
- except Exception as e:
158
- logger.error(f"Không detect được environment: {e}")
159
- environment ="unknown"
160
- remote_content = self.fetch_remote_content(
161
- context=context, html=(environment =="jupyter")
162
- )
163
- fallback = self._generate_fallback_content(context)
164
- if environment =="jupyter":
165
- try:
166
- from IPython.display import display, HTML, Markdown
167
- if remote_content:
168
- display(HTML(remote_content))
169
- else:
170
- try:
171
- display(Markdown(fallback["markdown"]))
172
- except Exception as e:
173
- display(HTML(fallback["html"]))
174
- except Exception as e:
175
- pass
176
- elif environment =="terminal":
177
- if remote_content:
178
- print(remote_content)
179
- else:
180
- print(fallback["terminal"])
181
- else:
182
- print(fallback["simple"])
183
-
184
- def _generate_fallback_content(self, context):
185
- fallback = {"html":"","markdown":"","terminal":"","simple":""}
186
- if context =="loop":
187
- fallback["html"] = (
188
- f"""
189
- <div style="border: 1px solid #e74c3c; padding: 15px; border-radius: 5px; margin: 10px 0;">
190
- <h3 style="color: #e74c3c;">⚠️ Bạn đang sử dụng vòng lặp với quá nhiều requests</h3>
191
- <p>Để tránh bị giới hạn tốc độ và tối ưu hiệu suất:</p>
192
- <ul>
193
- <li>Thêm thời gian chờ giữa các lần gọi API</li>
194
- <li>Sử dụng xử lý theo batch thay vì lặp liên tục</li>
195
- <li>Tham gia gói tài trợ <a href="https://vnstocks.com/insiders-program" style="color: #3498db;">Vnstock Insider</a> để tăng 5X giới hạn API</li>
196
- </ul>
197
- </div>
198
- """
199
- )
200
- fallback["markdown"] = (
201
- """
202
- ## ⚠️ Bạn đang sử dụng vòng lặp với quá nhiều requests
203
- Để tránh bị giới hạn tốc độ và tối ưu hiệu suất:
204
- * Thêm thời gian chờ giữa các lần gọi API
205
- * Sử dụng xử theo batch thay lặp liên tục
206
- * Tham gia gói tài trợ [Vnstock Insider](https://vnstocks.com/insiders-program) để tăng 5X giới hạn API
207
- """
208
- )
209
- fallback["terminal"] = (
210
- """
211
- ╔═════════════════════════════════════════════════════════════════╗
212
- ║ ║
213
- ║ 🚫 ĐANG BỊ CHẶN BỞI GIỚI HẠN API? GIẢI PHÁP Ở ĐÂY!
214
- ║ ║
215
- ║ ✓ Tăng ngay 500% tốc độ gọi API - Không còn lỗi RateLimit ║
216
- ║ ✓ Tiết kiệm 85% thời gian chờ đợi giữa các request ║
217
- ║ ║
218
- ║ ➤ NÂNG CẤP NGAY VỚI GÓI TÀI TRỢ VNSTOCK:
219
- ║ https://vnstocks.com/insiders-program ║
220
- ║ ║
221
- ╚═════════════════════════════════════════════════════════════════╝
222
- """
223
- )
224
- fallback["simple"] = (
225
- "🚫 Đang bị giới hạn API? Tăng tốc độ gọi API lên 500% với gói "
226
- "Vnstock Insider: https://vnstocks.com/insiders-program"
227
- )
228
- else:
229
- fallback["html"] = (
230
- f"""
231
- <div style="border: 1px solid #3498db; padding: 15px; border-radius: 5px; margin: 10px 0;">
232
- <h3 style="color: #3498db;">👋 Chào mừng bạn đến với Vnstock!</h3>
233
- <p>Cảm ơn bạn đã sử dụng thư viện phân tích chứng khoán #1 tại Việt Nam cho Python</p>
234
- <ul>
235
- <li>Tài liệu: <a href="https://vnstocks.com/docs/category/s%E1%BB%95-tay-h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn" style="color: #3498db;">vnstocks.com/docs</a></li>
236
- <li>Cộng đồng: <a href="https://www.facebook.com/groups/vnstock.official" style="color: #3498db;">vnstocks.com/community</a></li>
237
- </ul>
238
- <p>Khám phá các tính năng mới nhất và tham gia cộng đồng để nhận hỗ trợ.</p>
239
- </div>
240
- """
241
- )
242
- fallback["markdown"] = (
243
- """
244
- ## 👋 Chào mừng bạn đến với Vnstock!
245
- Cảm ơn bạn đã sử dụng package phân tích chứng khoán #1 tại Việt Nam
246
- * Tài liệu: [Sổ tay hướng dẫn](https://vnstocks.com/docs)
247
- * Cộng đồng: [Nhóm Facebook](https://facebook.com/groups/vnstock.official)
248
- Khám phá các tính năng mới nhất tham gia cộng đồng để nhận hỗ trợ.
249
- """
250
- )
251
- fallback["terminal"] = (
252
- """
253
- ╔════════════════════════════════════════════════════════════╗
254
- ║ ║
255
- ║ 👋 Chào mừng bạn đến với Vnstock! ║
256
- ║ ║
257
- ║ Cảm ơn bạn đã sử dụng package phân tích ║
258
- ║ chứng khoán #1 tại Việt Nam ║
259
- ║ ║
260
- ║ ✓ Tài liệu: https://vnstocks.com/docs ║
261
- ║ ✓ Cộng đồng: https://facebook.com/groups/vnstock.official ║
262
- ║ ║
263
- Khám phá các tính năng mới nhất và tham gia
264
- ║ cộng đồng để nhận hỗ trợ. ║
265
- ║ ║
266
- ╚════════════════════════════════════════════════════════════╝
267
- """
268
- )
269
- fallback["simple"] = (
270
- "👋 Chào mừng bạn đến với Vnstock! "
271
- "Tài liệu: https://vnstocks.com/onboard | "
272
- "Cộng đồng: https://facebook.com/groups/vnstock.official"
273
- )
274
- return fallback
275
- manager = ContentManager()
276
-
277
- def present(context: str ="init", ad_category: int = AdCategory.FREE) -> None:
1
+ import logging
2
+ import requests
3
+ from datetime import datetime
4
+ import random
5
+ import threading
6
+ import time
7
+ import urllib.parse
8
+ _vnii_check_attempted = False
9
+
10
+ class AdCategory:
11
+ FREE = 0
12
+ MANDATORY = 1
13
+ ANNOUNCEMENT = 2
14
+ REFERRAL = 3
15
+ FEATURE = 4
16
+ GUIDE = 5
17
+ SURVEY = 6
18
+ PROMOTION = 7
19
+ SECURITY = 8
20
+ MAINTENANCE = 9
21
+ WARNING = 10
22
+ try:
23
+ from vnii import lc_init
24
+ except ImportError:
25
+ lc_init = None
26
+ logger = logging.getLogger(__name__)
27
+ if not logger.hasHandlers():
28
+ handler = logging.StreamHandler()
29
+ handler.setFormatter(logging.Formatter('%(message)s'))
30
+ logger.addHandler(handler)
31
+ logger.setLevel(logging.ERROR)
32
+
33
+ class ContentManager:
34
+ _instance = None
35
+ _lock = threading.Lock()
36
+
37
+ def __new__(cls):
38
+ with cls._lock:
39
+ if cls._instance is None:
40
+ cls._instance = super(ContentManager, cls).__new__(cls)
41
+ cls._instance._initialize()
42
+ return cls._instance
43
+
44
+ def _initialize(self, debug=False):
45
+ self.content_base_url ="https://hq.vnstocks.com/content-delivery"
46
+ self.is_paid_user = None
47
+ self.license_checked = False
48
+ self._debug = debug
49
+ global _vnii_check_attempted
50
+ if _vnii_check_attempted:
51
+ return
52
+ _vnii_check_attempted = True
53
+ import sys
54
+ import importlib
55
+ try:
56
+ import importlib.metadata
57
+ VNII_LATEST_VERSION ="0.1.1"
58
+ VNII_URL =f"https://github.com/vnstock-hq/licensing/releases/download/vnii-{VNII_LATEST_VERSION}/vnii-{VNII_LATEST_VERSION}.tar.gz"
59
+ import subprocess
60
+ try:
61
+ old_version = importlib.metadata.version("vnii")
62
+ if old_version != VNII_LATEST_VERSION:
63
+ try:
64
+ subprocess.check_call([
65
+ sys.executable,"-m","pip","install",f"vnii@{VNII_URL}","--quiet"
66
+ ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
67
+ importlib.invalidate_caches()
68
+ if"vnii" in sys.modules:
69
+ importlib.reload(sys.modules["vnii"])
70
+ else:
71
+ import vnii
72
+ new_version = importlib.metadata.version("vnii")
73
+ except Exception as e:
74
+ logger.error(f"Lỗi khi cài đặt vnii: {e}")
75
+ pass
76
+ except importlib.metadata.PackageNotFoundError:
77
+ self.is_paid_user = False
78
+ return
79
+ except Exception as e:
80
+ logger.error(f"Lỗi khi kiểm tra/cài đặt vnii: {e}")
81
+ user_msg = (
82
+ "Không thể tự động cài đặt/cập nhật vnii. "
83
+ "Vui lòng liên hệ admin hoặc hỗ trợ kỹ thuật của Vnstock để được trợ giúp. "
84
+ f"Chi tiết lỗi: {e}"
85
+ )
86
+ logger.error(user_msg)
87
+ try:
88
+ print(user_msg)
89
+ except Exception:
90
+ pass
91
+ self.is_paid_user = False
92
+ return
93
+ if lc_init is not None:
94
+ try:
95
+ license_info = lc_init(repo_name='vnstock', debug=self._debug)
96
+ status = license_info.get('status','').lower()
97
+ if self._debug:
98
+ logger.info(f"License check result: {status}")
99
+ if'recognized and verified' in status:
100
+ self.is_paid_user = True
101
+ if self._debug:
102
+ logger.info("Detected paid user (license recognized and verified).")
103
+ else:
104
+ self.is_paid_user = False
105
+ if self._debug:
106
+ logger.info("Detected free user (license not recognized/verified).")
107
+ self.license_checked = True
108
+ except Exception as e:
109
+ if self._debug:
110
+ logger.error(f"Lỗi khi kiểm tra license với lc_init: {e}")
111
+ self.is_paid_user = None
112
+ else:
113
+ if self._debug:
114
+ logger.warning("Không tìm thấy package vnii. Không xác định được trạng thái paid user.")
115
+ self.is_paid_user = None
116
+ self.last_display = 0
117
+ self.display_interval = 24 * 3600
118
+ self.content_base_url ="https://hq.vnstocks.com/content-delivery"
119
+ self.target_url ="https://vnstocks.com/lp-khoa-hoc-python-chung-khoan"
120
+ self.image_url = (
121
+ "https://vnstocks.com/img/trang-chu-vnstock-python-api-phan-tich-giao-dich-chung-khoan.jpg"
122
+ )
123
+ self._start_periodic_display()
124
+
125
+ def _start_periodic_display(self):
126
+ def periodic_display():
127
+ while True:
128
+ if self.is_paid_user:
129
+ break
130
+ sleep_time = random.randint(2 * 3600, 6 * 3600)
131
+ time.sleep(sleep_time)
132
+ current_time = time.time()
133
+ if current_time - self.last_display >= self.display_interval:
134
+ self.present_content(context="periodic")
135
+ else:
136
+ pass
137
+ thread = threading.Thread(target=periodic_display, daemon=True)
138
+ thread.start()
139
+
140
+ def fetch_remote_content(self, context: str ="init", html: bool = True) -> str:
141
+ if self.is_paid_user:
142
+ return""
143
+ """
144
+ Fetch promotional content from remote service with context and format flag.
145
+ Args:
146
+ context: usage context (e.g., "init", "periodic", "loop").
147
+ html: if True, request HTML; otherwise plain text.
148
+ Returns:
149
+ The content string on HTTP 200, or None on failure.
150
+ """
151
+ try:
152
+ params = {"context": context,"html":"true" if html else"false"}
153
+ url =f"{self.content_base_url}?{urllib.parse.urlencode(params)}"
154
+ response = requests.get(url, timeout=3)
155
+ if response.status_code == 200:
156
+ return response.text
157
+ logger.error(f"Non-200 response fetching content: {response.status_code}")
158
+ return None
159
+ except Exception as e:
160
+ logger.error(f"Failed to fetch remote content: {e}")
161
+ return None
162
+
163
+ def present_content(self, context: str ="init", ad_category: int = AdCategory.FREE) -> None:
164
+ environment = None
165
+ if getattr(self,'is_paid_user', False) and ad_category == AdCategory.FREE:
166
+ return
167
+ self.last_display = time.time()
168
+ if environment is None:
169
+ try:
170
+ from vnai.scope.profile import inspector
171
+ environment = inspector.examine().get("environment","unknown")
172
+ except Exception as e:
173
+ logger.error(f"Không detect được environment: {e}")
174
+ environment ="unknown"
175
+ remote_content = self.fetch_remote_content(
176
+ context=context, html=(environment =="jupyter")
177
+ )
178
+ fallback = self._generate_fallback_content(context)
179
+ if environment =="jupyter":
180
+ try:
181
+ from IPython.display import display, HTML, Markdown
182
+ if remote_content:
183
+ display(HTML(remote_content))
184
+ else:
185
+ try:
186
+ display(Markdown(fallback["markdown"]))
187
+ except Exception as e:
188
+ display(HTML(fallback["html"]))
189
+ except Exception as e:
190
+ pass
191
+ elif environment =="terminal":
192
+ if remote_content:
193
+ print(remote_content)
194
+ else:
195
+ print(fallback["terminal"])
196
+ else:
197
+ print(fallback["simple"])
198
+
199
+ def _generate_fallback_content(self, context):
200
+ fallback = {"html":"","markdown":"","terminal":"","simple":""}
201
+ if context =="loop":
202
+ fallback["html"] = (
203
+ f"""
204
+ <div style="border: 1px solid #e74c3c; padding: 15px; border-radius: 5px; margin: 10px 0;">
205
+ <h3 style="color: #e74c3c;">⚠️ Bạn đang sử dụng vòng lặp với quá nhiều requests</h3>
206
+ <p>Để tránh bị giới hạn tốc độ tối ưu hiệu suất:</p>
207
+ <ul>
208
+ <li>Thêm thời gian chờ giữa các lần gọi API</li>
209
+ <li>Sử dụng xử lý theo batch thay vì lặp liên tục</li>
210
+ <li>Tham gia gói tài trợ <a href="https://vnstocks.com/insiders-program" style="color: #3498db;">Vnstock Insider</a> để tăng 5X giới hạn API</li>
211
+ </ul>
212
+ </div>
213
+ """
214
+ )
215
+ fallback["markdown"] = (
216
+ """
217
+ ## ⚠️ Bạn đang sử dụng vòng lặp với quá nhiều requests
218
+ Để tránh bị giới hạn tốc độ tối ưu hiệu suất:
219
+ * Thêm thời gian chờ giữa các lần gọi API
220
+ * Sử dụng xử lý theo batch thay vì lặp liên tục
221
+ * Tham gia gói tài trợ [Vnstock Insider](https://vnstocks.com/insiders-program) để tăng 5X giới hạn API
222
+ """
223
+ )
224
+ fallback["terminal"] = (
225
+ """
226
+ ╔═════════════════════════════════════════════════════════════════╗
227
+ ║ ║
228
+ ║ 🚫 ĐANG BỊ CHẶN BỞI GIỚI HẠN API? GIẢI PHÁP Ở ĐÂY! ║
229
+ ║ ║
230
+ ║ ✓ Tăng ngay 500% tốc độ gọi API - Không còn lỗi RateLimit ║
231
+ ║ ✓ Tiết kiệm 85% thời gian chờ đợi giữa các request ║
232
+ ║ ║
233
+ ║ ➤ NÂNG CẤP NGAY VỚI GÓI TÀI TRỢ VNSTOCK: ║
234
+ ║ https://vnstocks.com/insiders-program ║
235
+ ║ ║
236
+ ╚═════════════════════════════════════════════════════════════════╝
237
+ """
238
+ )
239
+ fallback["simple"] = (
240
+ "🚫 Đang bị giới hạn API? Tăng tốc độ gọi API lên 500% với gói "
241
+ "Vnstock Insider: https://vnstocks.com/insiders-program"
242
+ )
243
+ else:
244
+ fallback["html"] = (
245
+ f"""
246
+ <div style="border: 1px solid #3498db; padding: 15px; border-radius: 5px; margin: 10px 0;">
247
+ <h3 style="color: #3498db;">👋 Chào mừng bạn đến với Vnstock!</h3>
248
+ <p>Cảm ơn bạn đã sử dụng thư viện phân tích chứng khoán #1 tại Việt Nam cho Python</p>
249
+ <ul>
250
+ <li>Tài liệu: <a href="https://vnstocks.com/docs/category/s%E1%BB%95-tay-h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn" style="color: #3498db;">vnstocks.com/docs</a></li>
251
+ <li>Cộng đồng: <a href="https://www.facebook.com/groups/vnstock.official" style="color: #3498db;">vnstocks.com/community</a></li>
252
+ </ul>
253
+ <p>Khám phá các tính năng mới nhất và tham gia cộng đồng để nhận hỗ trợ.</p>
254
+ </div>
255
+ """
256
+ )
257
+ fallback["markdown"] = (
258
+ """
259
+ ## 👋 Chào mừng bạn đến với Vnstock!
260
+ Cảm ơn bạn đã sử dụng package phân tích chứng khoán #1 tại Việt Nam
261
+ * Tài liệu: [Sổ tay hướng dẫn](https://vnstocks.com/docs)
262
+ * Cộng đồng: [Nhóm Facebook](https://facebook.com/groups/vnstock.official)
263
+ Khám phá các tính năng mới nhất và tham gia cộng đồng để nhận hỗ trợ.
264
+ """
265
+ )
266
+ fallback["terminal"] = (
267
+ """
268
+ ╔════════════════════════════════════════════════════════════╗
269
+ ║ ║
270
+ 👋 Chào mừng bạn đến với Vnstock!
271
+ ║ ║
272
+ ║ Cảm ơn bạn đã sử dụng package phân tích ║
273
+ ║ chứng khoán #1 tại Việt Nam ║
274
+ ║ ║
275
+ ║ ✓ Tài liệu: https://vnstocks.com/docs ║
276
+ ║ ✓ Cộng đồng: https://facebook.com/groups/vnstock.official ║
277
+ ║ ║
278
+ ║ Khám phá các tính năng mới nhất và tham gia ║
279
+ ║ cộng đồng để nhận hỗ trợ. ║
280
+ ║ ║
281
+ ╚════════════════════════════════════════════════════════════╝
282
+ """
283
+ )
284
+ fallback["simple"] = (
285
+ "👋 Chào mừng bạn đến với Vnstock! "
286
+ "Tài liệu: https://vnstocks.com/onboard | "
287
+ "Cộng đồng: https://facebook.com/groups/vnstock.official"
288
+ )
289
+ return fallback
290
+ manager = ContentManager()
291
+
292
+ def present(context: str ="init", ad_category: int = AdCategory.FREE) -> None:
278
293
  manager.present_content(context=context, ad_category=ad_category)