Skip to content

debemenitammy/discord-command-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Node.js Discord Command Bot Function

Simple command using Discord Interactions.

🧰 Usage

POST /interactions

Webhook to receive Discord command events. To receive events, you must register your application as a Discord bot.

Parameters

Name Description Location Type Sample Value
x-signature-ed25519 Signature of the request payload Header string d1efb...aec35
x-signature-timestamp Timestamp of the request payload Header string 1629837700
JSON Body GitHub webhook payload Body Object See Discord docs

Response

Sample 200 Response:

Returns a Discord message object.

{
  "type": 4,
  "data": {
    "content": "Hello from Appwrite 👋"
  }
}

Sample 401 Response:

{
  "error": "Invalid request signature"
}

⚙️ Configuration

Setting Value
Runtime Node (18.0)
Entrypoint src/main.js
Build Commands npm install
Permissions any
Timeout (Seconds) 15

🔒 Environment Variables

DISCORD_PUBLIC_KEY

Public Key of your application in Discord Developer Portal.

Question Answer
Required Yes
Sample Value db9...980
Documentation Discord Docs

DISCORD_APPLICATION_ID

ID of your application in Discord Developer Portal.

Question Answer
Required Yes
Sample Value 427...169
Documentation Discord Docs

DISCORD_TOKEN

Bot token of your application in Discord Developer Portal.

Question Answer
Required Yes
Sample Value NDI...LUfg
Documentation Discord Docs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages