Skip to content

de-y/dpyrandmeme

Repository files navigation

dpyrandmeme: random memes for discord.py

What does the library do? This library simply uses aiohttp to collect json data from a reddit page and turns it into a link inorder to be used while also storing the memes and returning the meme as a discord embed before sending back to the discord bot to send to the member who sent that command. It is the same meme library that is currently being used inside Paradigm.
PyPi library link: https://pypi.org/project/dpyrandmeme/

USAGE OF CODE IN A DISCORD SLASH COMMAND COG:

"""
  This snippet is the actual meme slash command code from the Paradigm Source Code.
"""

from discord.ext import commands
from dpyrandmeme import pyrandmeme


class Meme(commands.Cog):
    def __init__(self, client):
        self.client = client

    @commands.hybrid_command()
    @commands.cooldown(1, 1, commands.BucketType.user)
    async def meme(self, ctx):
        """
        Get some random memes from reddit.
        """

        await ctx.send(embed=await pyrandmeme())

async def setup(client):
    await client.add_cog(Meme(client))


**Credits:**

d33pak123: https://github.com/d33pak123/Pyrandmeme-python-library,
Microsoft for the template.



©2023 aviance. Project is open-source through the MIT License.

About

Random memes for discord.py

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published