|
|
@@ -1,4 +1,5 @@
|
|
|
import random
|
|
|
+import requests as r
|
|
|
from pyrogram.types import Message
|
|
|
from pyrogram import filters
|
|
|
from wbb import app
|
|
|
@@ -46,3 +47,23 @@ femnnism, tehc, hacc, stonks, sekuriti,
|
|
|
phijiks, welth, smrt`''')
|
|
|
print(random)
|
|
|
exec(result)
|
|
|
+
|
|
|
+
|
|
|
+@app.on_message(cust_filter.command(commands=("reddit")) & ~filters.edited)
|
|
|
+async def reddit(_, message: Message):
|
|
|
+ app.set_parse_mode('html')
|
|
|
+ if len(message.command) != 2:
|
|
|
+ await message.reply_text("/reddit needs an argument")
|
|
|
+ subreddit = message.command[1]
|
|
|
+ res = r.get(f"https://meme-api.herokuapp.com/gimme/{subreddit}")
|
|
|
+ res = res.json()
|
|
|
+
|
|
|
+ rpage = res.get(str("subreddit")) # Subreddit
|
|
|
+ title = res.get(str("title")) # Post title
|
|
|
+ memeu = res.get(str("url")) # meme pic url
|
|
|
+ plink = res.get(str("postLink"))
|
|
|
+
|
|
|
+ caps = f"<b>Title</b>: {title}\n"
|
|
|
+ caps += f"<b>Subreddit: </b>r/{rpage}\n"
|
|
|
+ caps += f"<b>PostLink:</b> {plink}"
|
|
|
+ await message.reply_photo(photo=memeu, caption=(caps))
|