To setup a discord you first need to create an application (basically a bot), here are the steps to follow:
-
Visit Discord Application
-
Now here you will see your newly created application, click on it, this should open "General Information"
-
If you scroll down, you will se PUBLIC KEY, copy it and place it
.envas DISCORD_PUBLIC_KEY -
Once you have the token, place it against BOT_TOKEN in
.env -
Now will be creating an invite URL and for that you need to click on OAuth2 > bot

-
Now as soon as you click on bot, a section to choose bot permission from, will shown up

-
Check the following options
- Send Messages
-
Once you select all the bot permissions, scroll a bit down and you will see "Generated URL"

-
Copy and paste that URL in browser, a prompt will come up where it will ask you to select you own "Discord Server"

-
Once you add the Bot into your server, copy the "Server Id", by right clicking on the server avatar. Now place this id in
.envagainst GUILD_ID
Now as you have created the discord bot, now its time to connect it with discord service using the following steps:
- You would need to register the commands first. That will be auto handled once you start the server
- Now start the server using
make run #or go run .- For IP tunneling, need to run NGROK, use the following command
make ngrok #or ngrok http 8999Since we are considering 8999 as default port for this service. If you wish to change it you can change it in Makefile & in docker-compose.yml
- Copy the Ngrok URL and open the General Information on Discord Developer Portal of your bot, paste the copied URL in Interactions Endpoint URL

- All Set 🚀🚀🚀. Now you can start with running hello command


