Skip to content

george-silviu/node-discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Discord Bot

Node.js Discord bot that can:

  • ✅ display the weather forecast;
  • ✅ display the position of sun and moon;
  • ✅ tell jokes;
  • ✅ inspire you with quotes from different categories;

General overview

app-schema

In our Node app, the Discord Bot will connect to Discord API using discord.js library through WebSocket connection, and will listen for any commands prompted from the Discord UI. The Bot has defined a set of commands that will run each time a user uses a slash command.

Bot tutorial in Discord Client

🔗The video tutorial test from Discord client

Steps for setup

  1. Be sure you haveNode.js installed.
  2. Open a terminal and run npm install.
  3. Create a new Discord account if you do not have one.
  4. Create a Discord server to test the bot, then find the server/guild ID by turning the developer mode.
  5. Navigate to Discord Developers page and create a new app, then find the application/client ID.
  6. Invite the bot to your server.
  7. Sign up to a free Weather API account and find your API key.
  8. Sign up to a free API Ninjas account and find your API key.
  9. Create a .env file at the root of the project and insert the data as below.

Environment variables

Populate the following values in .env:

DISCORD_TOKEN=
CLIENT_ID=
GUILD_ID=
WHEATHER_API_KEY=
API_NINJAS_KEY=

Running the project

  • Production script: npm start
  • Development: npm run dev

📌 Resources

🤔Fun stuff to do next:

  • Integrate the bot with AI
  • Integrate bot with a music streaming service

About

Multifunctional discord bot

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published