Skip to main content

Random memes fetched for use in discord.py bot commands.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dpyrandmeme-1.0.1rc32.post1.tar.gz (18.3 kB view hashes)

Uploaded Source

Built Distribution

dpyrandmeme-1.0.1rc32.post1-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page