Skip to content

Add Discord bot API endpoints for Q-isms#2

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-1
Draft

Add Discord bot API endpoints for Q-isms#2
Copilot wants to merge 2 commits intomainfrom
copilot/fix-1

Conversation

Copy link

Copilot AI commented Sep 3, 2025

This PR implements the Discord bot functionality requested in the issue by adding two new API endpoints that serve random Q-isms from the existing data.json file.

New API Endpoints

/api/qism - General Purpose Endpoint

Returns a random Q-ism in a clean JSON format suitable for general API consumption:

{
  "success": true,
  "quote": "The greatest form of flattery is mimication.",
  "author": "Q (Tony)"
}

/api/discord/qism - Discord Bot Endpoint

Returns a random Q-ism formatted specifically for Discord slash command responses:

{
  "type": 4,
  "data": {
    "content": "\"The greatest form of flattery is mimication.\"\n\n*- Q (Tony)*",
    "flags": 0
  }
}

Implementation Details

  • Both endpoints read from the existing public/data.json file (48 Q-isms)
  • Random selection using Math.floor(Math.random() * quotes.length)
  • Support for both GET and POST HTTP methods
  • Proper error handling with 500 status codes for failures
  • Discord endpoint follows Discord's interaction response format with type: 4 (ChannelMessageWithSource)

Testing

  • Verified randomization works correctly across multiple requests
  • Confirmed original application functionality remains unchanged
  • Tested both development and production builds
  • All endpoints respond correctly to GET and POST methods

Documentation

Added API_DOCUMENTATION.md with complete usage examples, Discord integration instructions, and endpoint specifications.

Discord bots can now use /qism slash commands that call these endpoints to return random Q-isms to users.

Fixes #1.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.fontshare.com
    • Triggering command: /usr/local/bin/node --enable-source-maps /home/REDACTED/work/Q-isms/Q-isms/node_modules/nuxi/bin/nuxi.mjs _dev (dns block)
    • Triggering command: node /home/REDACTED/work/Q-isms/Q-isms/node_modules/.bin/nuxt build (dns block)
  • api.fontsource.org
    • Triggering command: node /home/REDACTED/work/Q-isms/Q-isms/node_modules/.bin/nuxt build (dns block)
  • fonts.bunny.net
    • Triggering command: /usr/local/bin/node --enable-source-maps /home/REDACTED/work/Q-isms/Q-isms/node_modules/nuxi/bin/nuxi.mjs _dev (dns block)
    • Triggering command: node /home/REDACTED/work/Q-isms/Q-isms/node_modules/.bin/nuxt build (dns block)
  • fonts.google.com
    • Triggering command: /usr/local/bin/node --enable-source-maps /home/REDACTED/work/Q-isms/Q-isms/node_modules/nuxi/bin/nuxi.mjs _dev (dns block)
    • Triggering command: node /home/REDACTED/work/Q-isms/Q-isms/node_modules/.bin/nuxt build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Author

Copilot AI commented Sep 3, 2025

@thewebbeckons 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@netlify
Copy link

netlify bot commented Sep 3, 2025

Deploy Preview for qisms ready!

Name Link
🔨 Latest commit 556685b
🔍 Latest deploy log https://app.netlify.com/projects/qisms/deploys/68b853e1fb07a3000711ee30
😎 Deploy Preview https://deploy-preview-2--qisms.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Co-authored-by: thewebbeckons <3504767+thewebbeckons@users.noreply.github.com>
Copilot AI changed the title [WIP] Recreate Discord Bot Add Discord bot API endpoints for Q-isms Sep 3, 2025
Copilot AI requested a review from thewebbeckons September 3, 2025 14:45
@nuxthub-admin
Copy link
Contributor

nuxthub-admin bot commented Sep 3, 2025

❌ Deployment failed q-isms

Failed to deploy q-isms 556685b to preview

📋 View deployment logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recreate Discord Bot

2 participants