Beginner 1-2 hours · 2 APIs

Build a Developer Joke Bot

A fun bot that serves programming jokes paired with motivational programming quotes. Great for Slack or Discord integration.

APIs Used

Data Flow

USER User triggers the bot (command or schedule) API Fetch a random programming joke via JokeAPI API Fetch a programming quote via Programming Quotes PROCESS Format joke and quote into a message OUTPUT Display or post to Slack/Discord
User Action
API Call
Transform
Output

How It Works

1

Fetch a random programming joke from JokeAPI

2

Fetch a random programming quote for inspiration

3

Format both into a nice message

4

Optionally post to Slack/Discord webhook

Code Outline

Pseudocode / JavaScript
// 1. Get a programming joke
const jokeRes = await fetch('https://v2.jokeapi.dev/joke/Programming?safe-mode');
const joke = await jokeRes.json();

// 2. Get a programming quote
const quoteRes = await fetch('https://programming-quotesapi.vercel.app/api/random');
const quote = await quoteRes.json();

// 3. Format the message
const jokeText = joke.type === 'single'
  ? joke.joke
  : `${joke.setup}\n${joke.delivery}`;

const message = `
--- Developer Break ---
Joke: ${jokeText}

Quote: "${quote.quote}" - ${quote.author}
-----------------------`;

console.log(message);

// 4. Optional: Post to Slack webhook
// await fetch('YOUR_SLACK_WEBHOOK', {
//   method: 'POST',
//   body: JSON.stringify({ text: message })
// });

Note: These recipes are AI-generated suggestions based on API capabilities. Actual implementation may vary. Always refer to official API documentation for the latest specifications.