Node.js Discord Bot: Create GitHub Issues with Slash Commands

A Discord bot that can help you create Github issues from the Discord chat via Slash Commands, let's begin.

We will be using Nodejs to build the bot while using the discord.js library. For the bot to talk to GitHub we will be using the GitHub-provided SDK Octokit. To deal with environment variables, we will be using the npm package Dotenv. The Octokit SDK that will talk to GitHub needs a fetch package; for that, we will be installing the package Node Fetch. We will be using two more libraries to be able to enable slash commands, @discordjs/rest and @discordjs/builders. Also, let's install another package named discord-api-types for type definitions.

That was all about installing packages. Now we will move on to some actual coding.

Create a project folder with your bot project name. And do npm init, to initialize npm.

NPM is our package manager, and all the packages we talked about will be installed through npm commands.

npm install dotenv discord.js @discordjs/rest @discordjs/builders discord-api-types/v10 node-fetch octokit

Write a comment ...

Vishnu Dileesh

Show your support

Hey there! 👋 I love sharing my coding journey, insights, and tutorials to help fellow developers grow. If you've found my content valuable, consider supporting my work! Your contributions help me keep creating quality content, explore new topics, and share more useful resources with the community. Thanks for your support! ❤️

Write a comment ...