diff --git a/ubot/modules/memes.py b/ubot/modules/memes.py index 2c576bd..8156066 100644 --- a/ubot/modules/memes.py +++ b/ubot/modules/memes.py @@ -136,6 +136,18 @@ async def dadjoke(event): await event.reply(dad_joke) +@ldr.add("fact") +async def randomfact(event): + async with ldr.aioclient.get("https://uselessfacts.jsph.pl/random.json", params={"language": "en"}) as response: + if response.status == 200: + random_fact = (await response.json())["text"].replace("`", "'") + else: + await event.reply(f"An error occured: **{response.status}**") + return + + await event.reply(random_fact) + + async def shitpostify(text): text = text.replace("dick", "peepee") text = text.replace("ck", "cc")