succ.py 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import requests as r
  2. from pyrogram.types import Message
  3. from pyrogram import filters
  4. from wbb import app
  5. from wbb.utils import cust_filter
  6. from wbb.utils.errors import capture_err
  7. __MODULE__ = "Succ"
  8. __HELP__ = """/succ - Sends Succ Image For A Given Argument
  9. /reddit [query] - results something from reddit"""
  10. hack = [
  11. "https://i.ibb.co/YLLhCtt/i.png",
  12. "https://i.ibb.co/DMzyLMZ/e.jpg",
  13. "https://i.ibb.co/sqngHGt/d.jpg",
  14. "https://i.ibb.co/b1Y1rGf/a.jpg",
  15. ]
  16. kemeest = "'https://i.ibb.co/bB4pqNN/i.jpg'"
  17. educ = "'https://i.ibb.co/LCB3yTX/q.jpg'"
  18. health = "'https://i.ibb.co/TKHxkH4/m.jpg'"
  19. nhealth = "'https://i.ibb.co/dBVBzJY/p.jpg'"
  20. feminism = "'https://i.ibb.co/PNhPJR1/o.jpg'"
  21. security = "'https://i.ibb.co/ctf3MGM/c.jpg'"
  22. def suck(text):
  23. socc = {
  24. "komidi": 'message.reply_photo("https://i.ibb.co/mRL3Nnf/j.jpg")',
  25. "kemist": f"message.reply_photo({kemeest})",
  26. "ejucation": f"message.reply_photo({educ})",
  27. "helth": f"message.reply_photo({health})",
  28. "nothelth": f"message.reply_photo({nhealth})",
  29. "femnnism": f"message.reply_photo({feminism})",
  30. "tehc": 'message.reply_photo("https://i.ibb.co/gdSvHSr/n.jpg")',
  31. "stonks": 'message.reply_photo("https://i.ibb.co/TtZ144x/h.png")',
  32. "sekuriti": f"message.reply_photo({security})",
  33. "phijiks": 'message.reply_photo("https://i.ibb.co/Zz4wBnc/g.png")',
  34. "welth": 'message.reply_photo("https://i.ibb.co/JxFm4pW/k.jpg")',
  35. "smrt": 'message.reply_photo("https://i.ibb.co/7bVkyC7/l.jpg")',
  36. "linuks": 'message.reply_photo("https://i.ibb.co/m6b0cB1/image.png")',
  37. "hacc": "message.reply_photo(random.choice(hack))",
  38. }
  39. return socc.get(text)
  40. @app.on_message(cust_filter.command(commands=("succ")) & ~filters.edited)
  41. @capture_err
  42. def succ(_, message: Message):
  43. if len(message.command) != 2:
  44. message.reply_text(
  45. """"/succ" Needs And Argument
  46. Args - `komidi, kemist, ejucation, helth, nothelth,
  47. femnnism, tehc, hacc, stonks, sekuriti,
  48. phijiks, welth, smrt`"""
  49. )
  50. result = suck(message.text.split(None, 1)[1])
  51. if result is None:
  52. message.reply_text(
  53. """"/succ" Needs And Argument
  54. Args - `komidi, kemist, ejucation, helth, nothelth,
  55. femnnism, tehc, hacc, stonks, sekuriti,
  56. phijiks, welth, smrt`"""
  57. )
  58. exec(result)
  59. @app.on_message(cust_filter.command(commands=("reddit")) & ~filters.edited)
  60. @capture_err
  61. async def reddit(_, message: Message):
  62. app.set_parse_mode("html")
  63. if len(message.command) != 2:
  64. await message.reply_text("/reddit needs an argument")
  65. subreddit = message.command[1]
  66. res = r.get(f"https://meme-api.herokuapp.com/gimme/{subreddit}")
  67. res = res.json()
  68. rpage = res.get(str("subreddit")) # Subreddit
  69. title = res.get(str("title")) # Post title
  70. memeu = res.get(str("url")) # meme pic url
  71. plink = res.get(str("postLink"))
  72. caps = f"<b>Title</b>: {title}\n"
  73. caps += f"<b>Subreddit: </b>r/{rpage}\n"
  74. caps += f"<b>PostLink:</b> {plink}"
  75. await message.reply_photo(photo=memeu, caption=(caps))