randydev commited on
Commit
d465bd1
·
verified ·
1 Parent(s): 058bc13

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +16 -2
main.py CHANGED
@@ -10,8 +10,11 @@ from akenoai.runner import run_fast
10
  from akenoai.clients import create_pyrogram
11
  from akenoai.clients.enums import ChatMembersFilter
12
  from akenoai.middleware.cors import CORSMiddleware
 
13
  from pyrogram.enums import *
14
  from pyrogram.errors import *
 
 
15
 
16
  from config import API_ID, API_HASH, BOT_TOKEN, SESSION
17
 
@@ -181,15 +184,26 @@ ALERT_WARN = """
181
  🔗 Need help? Contact support: @xpushz
182
  """
183
 
 
 
 
 
 
184
  @fast_app.get("/user/tg/send_message")
185
- async def user_send_message(user_id: int = None, api_key: str = None, text_log: str = None):
186
  try:
 
 
 
 
 
187
  await bot.send_message(
188
  user_id,
189
  text=ALERT_WARN.format(
190
  api_key=api_key,
191
  text_log=text_log
192
- )
 
193
  )
194
  return {"status": True}
195
  except Exception as e:
 
10
  from akenoai.clients import create_pyrogram
11
  from akenoai.clients.enums import ChatMembersFilter
12
  from akenoai.middleware.cors import CORSMiddleware
13
+
14
  from pyrogram.enums import *
15
  from pyrogram.errors import *
16
+ from pyrogram.types import *
17
+ from pyrogram import filters
18
 
19
  from config import API_ID, API_HASH, BOT_TOKEN, SESSION
20
 
 
184
  🔗 Need help? Contact support: @xpushz
185
  """
186
 
187
+ @bot.on_callback_query(filters.regex("^alert_"))
188
+ async def _alert(_, cb):
189
+ query = cb.data.split("_", 1)
190
+ await cb.answer(query, show_alert=True)
191
+
192
  @fast_app.get("/user/tg/send_message")
193
+ async def user_send_message(user_id: int = None, api_key: str = None, text_log: str = None, ips: str = None):
194
  try:
195
+ bttn = [
196
+ [
197
+ InlineKeyboardButton("👁️ IP ADRS", callback_data=f"alert_{ips}"),
198
+ ],
199
+ ]
200
  await bot.send_message(
201
  user_id,
202
  text=ALERT_WARN.format(
203
  api_key=api_key,
204
  text_log=text_log
205
+ ),
206
+ reply_markup=btn
207
  )
208
  return {"status": True}
209
  except Exception as e: