succ.py 2.6 KB

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