DEV Community

Cover image for #NEW #2023 | Create Your Own Discord Bot with DiscordJS and TypeScript in 3 Minutes! (By uynilo9 on o9Studio)
uynlio9
uynlio9

Posted on • Updated on

#NEW #2023 | Create Your Own Discord Bot with DiscordJS and TypeScript in 3 Minutes! (By uynilo9 on o9Studio)

Intro

Do you wanna create your own Discord bot quickly and smartly?
You might choose DiscordJS and TypeScript to create one.
Alright, let’s do it by following these steps easily!

Steps

1.

Fork the template from GitHub:

git clone https://github.com/o9studio/djs-ts.git
Enter fullscreen mode Exit fullscreen mode

2.

Install the dependencies:

npm install      # Using npm
yarn install     # Using yarn
Enter fullscreen mode Exit fullscreen mode

3.

Enter the enviroment variables in example.env:

BOT_ID=     # Bot's ID
BOT_TOKEN=  # Bot's token
GUILD_ID=   # Server ID
Enter fullscreen mode Exit fullscreen mode

4.

Rename example.env to .env:

mv ./example.env ./.env
Enter fullscreen mode Exit fullscreen mode

5.

Start your bot:

npm run tsn:bot  # Using npm
yarn tsn:bot     # Using yarn
Enter fullscreen mode Exit fullscreen mode

6.

Play with your bot and enjoy!

Outro

Unbelievable! Now, you’ve perfectly created your own Discord bot in 3 minutes.
Please star this template repo if you think this tutorial is helpful!
Follow @uynilo9 and @o9Studio on GitHub for more tutorials!

Top comments (3)

Collapse
 
mannu profile image
Mannu • Edited

Good Job. Keep Going ❤❤

I am also interested in discord development so if you are free we can work on a same discord bot.

Collapse
 
uynilo9 profile image
uynlio9

Thank you for reading and correcting! I’ve fixed it.

I’m glad that you are also interested in developing discord bot. I’ve followed you.
btw, I’m gonna post the next article for creating discord bot in TypeScript.
Let’s work together! My email is: uynilo9@outlook.com

Collapse
 
mannu profile image
Mannu

Thanks for this but I do prefer python for discord bot, but I'll caught up with discordTS as soon as possible. Then I'll sure send a mail. <3