Update main.py
Browse files
main.py
CHANGED
@@ -181,16 +181,35 @@ ALERT_WARN = """
|
|
181 |
|
182 |
β οΈ If you didn't authorize this, **revoke your API key immediately** to prevent unauthorized access.
|
183 |
|
184 |
-
π **Never share your user_id** β it can be used for hacking attempts.
|
185 |
-
|
186 |
π Need help? Contact support: @xpushz
|
187 |
"""
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
@bot.on_callback_query(filters.regex("^alert_"))
|
190 |
async def _alert(_, cb):
|
191 |
query = cb.data.split("_", 1)
|
192 |
await cb.answer(query, show_alert=True)
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
@fast_app.get("/user/tg/send_message")
|
195 |
async def user_send_message(user_id: int = None, api_key: str = None, text_log: str = None):
|
196 |
try:
|
@@ -204,7 +223,7 @@ async def user_send_message(user_id: int = None, api_key: str = None, text_log:
|
|
204 |
return {"status": True}
|
205 |
except Exception as e:
|
206 |
return None
|
207 |
-
|
208 |
@fast_app.get("/user/author/admin")
|
209 |
async def get_author_chat_admin(username: str = None):
|
210 |
same_user = {}
|
|
|
181 |
|
182 |
β οΈ If you didn't authorize this, **revoke your API key immediately** to prevent unauthorized access.
|
183 |
|
|
|
|
|
184 |
π Need help? Contact support: @xpushz
|
185 |
"""
|
186 |
|
187 |
+
NOTIF_KEY = """
|
188 |
+
π¨ **Notification: API Key Expired (Premium Required)!**
|
189 |
+
|
190 |
+
Your current API key has expired. To continue using premium features, please upgrade to **Premium v2** first.
|
191 |
+
|
192 |
+
π **API Key:** <spoiler>{api_key}</spoiler>
|
193 |
+
|
194 |
+
π Need help? Contact support: @xpushz
|
195 |
+
"""
|
196 |
+
|
197 |
@bot.on_callback_query(filters.regex("^alert_"))
|
198 |
async def _alert(_, cb):
|
199 |
query = cb.data.split("_", 1)
|
200 |
await cb.answer(query, show_alert=True)
|
201 |
|
202 |
+
@fast_app.get("/user/tg/notifications")
|
203 |
+
async def user_send_notif(user_id: int = None, api_key: str = None):
|
204 |
+
try:
|
205 |
+
await bot.send_message(
|
206 |
+
user_id,
|
207 |
+
text=NOTIF_KEY.format(api_key=api_key)
|
208 |
+
)
|
209 |
+
return {"status": True}
|
210 |
+
except Exception as e:
|
211 |
+
return None
|
212 |
+
|
213 |
@fast_app.get("/user/tg/send_message")
|
214 |
async def user_send_message(user_id: int = None, api_key: str = None, text_log: str = None):
|
215 |
try:
|
|
|
223 |
return {"status": True}
|
224 |
except Exception as e:
|
225 |
return None
|
226 |
+
|
227 |
@fast_app.get("/user/author/admin")
|
228 |
async def get_author_chat_admin(username: str = None):
|
229 |
same_user = {}
|