Skip to content

Discord Bot Written in JavaScript with the Node.js platform using ECMAScript Modules.

License

Notifications You must be signed in to change notification settings

aminnairi/discord-bot-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discord-bot-template

Discord Bot Written in JavaScript with the Node.js platform using ECMAScript Modules.

1. Install the requirements

  • Node.js
  • NPM

2. Install the Discord JavaScript module

$ npm install

3. Create the configuration file

$ touch settings.json

Warning: this file should never be put in versionning or disclosed.

4. Edit the configuration file

{
  "token": "yourbottoken"
}

Where yourbottoken is the token you copied from your Developer Portal's application bot.

5. Start the bot

$ npm start

5. TODO

  • Import the file system Node.js built-in module
  • Import the Discord JavaScript library
  • Read the content of the configuration file as raw text and then
  • Handle any configuration reading errors
  • Parse the content of the configuration file as JSON
  • Handle any parse errors
  • Initialize the Discord client with the wanted intents
  • Listen for when the bot is ready
  • Login with the token
  • Listen for when a message is sent
  • Listen for when an error occurred
  • Handle any login errors

About

Discord Bot Written in JavaScript with the Node.js platform using ECMAScript Modules.

Resources

License

Stars

Watchers

Forks