succ.py 2.9 KB

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