succ.py 2.7 KB

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