Closed namanyt closed 3 years ago
this takes meme commands from reddit, and makes a embed and sends it,
from random import choice from requests import get from discord import Embed from discord.ext.commands import Cog, command class Meme(Cog): def __init__(self, bot): self.bot = bot @command(name='meme') async def meme_maker_and_sender(self, ctx): reddit = 'memes' r = get(f"https://memes.blademaker.tv/api/{reddit}") res = r.json() title = res['title'] image = res['image'] sub = res['subreddit'] UpVotes = res['ups'] DownVote = res['downs'] nsfw = res['nsfw'] yes = True while yes: if nsfw: pass else: meme_embed = Embed(title=title, description=f"if the image doesn't load, click on the title !", url=image) meme_embed.set_image(url=image) meme_embed.set_footer(text=f'👍:{UpVotes} | 👎:{DownVote}') await ctx.send(embed=meme_embed) break @Cog.listener() async def on_ready(self): if not self.bot.ready: self.bot.cogs_ready.ready_up('meme') def setup(bot): bot.add_cog(Meme(bot))
We are not convinced that this would add any value to the bot.
this takes meme commands from reddit, and makes a embed and sends it,