f.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
  2. from wbb import app
  3. from pyrogram import filters
  4. from wbb.utils.errors import capture_err
  5. i = 0
  6. m = None
  7. pressers = []
  8. keyboard = InlineKeyboardMarkup(
  9. [
  10. [
  11. InlineKeyboardButton("F", callback_data="ff"),
  12. InlineKeyboardButton("Delete", callback_data="deletef")
  13. ]
  14. ]
  15. )
  16. @app.on_message(filters.command("f"))
  17. @capture_err
  18. async def f(_, message):
  19. global i, m, pressers
  20. i = 0
  21. pressers = []
  22. try:
  23. await m.delete()
  24. except:
  25. pass
  26. m = await app.send_message(message.chat.id, text=f"Press F To Pay Respect.\nRespect = `{i}`", reply_markup=keyboard)
  27. @app.on_callback_query(filters.regex("ff"))
  28. async def end_callbacc(_, CallbackQuery):
  29. global i, m, pressers
  30. i += 1
  31. user_id = CallbackQuery.from_user.id
  32. if user_id in pressers:
  33. await app.answer_callback_query(CallbackQuery.id,
  34. "Didn't You Already Pressed 'F' like 0.0069 Seconds Ago?",
  35. show_alert=True
  36. )
  37. return
  38. pressers.append(user_id)
  39. await m.edit(text=f"Press F To Pay Respect.\nRespect = `{i}`", reply_markup=keyboard)
  40. await app.answer_callback_query(CallbackQuery.id, "Respect +", show_alert=True)
  41. @app.on_callback_query(filters.regex("deletef"))
  42. async def del_callbacc(_, CallbackQuery):
  43. global i, m, pressers
  44. pressers = []
  45. i = 0
  46. await app.send_message(CallbackQuery.message.chat.id, text=f"{CallbackQuery.from_user.id} Deleted F's")
  47. await m.delete()