Fun Responses

The docs for Fun Responses.

Info

Fun Responses was created as a way for me to get jokes and topics for a command on my Discord bot. I decided that it would be more useful to make it a NPM package so I could let other people use it. Eventually I made it into a PyPI package due to me wanting to convert my bot info Python. I created a browser module as an attempt to understand scripting for the web better.

I might not work on this project as much anymore as I don't have much will to. I'll probably add more responses to the JSON file over time so it isn't the same things being sent over and over again.


It's a little cramped on this small screen. Try rotating your device or visit this page on a bigger display.

Install

npm install fun-responses

Example Usage

const fun = require('fun-responses');

async function run() {
    console.log(' - Joke')
    console.log(await fun.joke())
    console.log(' - Pickup Line')
    console.log(await fun.pickup())
    console.log(' - Topic')
    console.log(await fun.topic())
    console.log(' - Roast')
    console.log(await fun.roast())
    console.log(' - Toast')
    console.log(await fun.toast())
}
run()

Example Discord.js Usage

const Discord = require('discord.js');
const funRes = require('fun-responses');

async function topicSend() {
    const embed = new Discord.MessageEmbed()
        .setDescription(await funRes.topic())
    message.channel.send(embed).then().catch(console.error);
}

topicSend();

Install

pip install fun-responses

Example Usage

import funresponses

print(funresponses.joke())
print(funresponses.topic())
print(funresponses.pickup())
print(funresponses.roast())
print(funresponses.toast())

About

This script will get topics, jokes, etc. and replace the content of the HTML element with what you set as the ID. See example below.

Important:
After the script is executed, the ID will have a prefix attached to it, p-. Please keep this in mind during CSS and advanced scripting.

Install

<script src="https://void206551.dev/projects/fun/fun_responses-latest.js" type="module"></script>

Or download and install from the latest release.

Example Usage

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Fun Responses</title>
</head>
<body>

    <p id="joke">Joke</p>
    <p id="topic">Topic</p>
    <p id="pickup">Pickup Line</p>
    <p id="toast">Toast</p>
    <p id="roast">Roast</p>

<script src="fun_responses-latest.js" type="module"></script>
</body>
</html>

You can also check out the live demo.