DogeCoin alert bot for Discord

Vinayak Sharma
5 min readMay 7, 2021

Dogecoin is currently the most popular cryptocurrency, Mostly due to its significant growth and funny tweets by Elon Musk about it.

A huge amount of people have recently started to invest in Dogecoin. Usually, the trading platforms provide good enough price alert features that fulfill all your dogecoin-related needs but if you want more out of DogeCoin you should definitely build yourself a Discord bot that alerts you about the price of Dogecoin after every minute or after every 5 minutes.

There are a lot of paid options available on the internet for getting a Discord crypto price alert bot, but the bot that we will be building is totally free and requires barely any coding knowledge.

Yes, you read it right, It requires absolutely no coding knowledge. Just follow the steps and you will have your own discord bot ready in less than 15 minutes!

To be able to build this Bot we are going to use a few different platforms and APIs.

Now let’s get started with building this Discord bot from scratch.

The first step to build this bot is getting the live price of Dogecoin (or any other cryptocurrency). To do this, we are going to go to https://p.nomics.com/cryptocurrency-bitcoin-api. You simply have to enter your Email Id in the prompt (refer to the image below). After entering your Email Id you will get a secret key in your Email. Save this key as we are going to use it for your Discord bot.

The next step is to create an account at AutoCode. We are going to use Autocode for running our Discord bot. AutoCode provides 100,000 free operations a month. These operations will help us run our bot for free.

After creating an account on Autocode, Click on the “new project” button in the top-right position of your dashboard.

AutoCode will automatically open the new project that you just created in your browser window. You will be able to see something similar to the below photo.

Next head towards the “+” button As depicted in the below image. Click on the option “New endpoint”.

After this select the tab saying “HTTP(s)….” for opening a detailed menu of the available types of triggers. Select the Scheduler trigger option.

In the second dropdown select “Once every x minutes”.

After selecting “Once every x minutes” it will ask you the frequency you want to have for your trigger. The ideal option is 5 minutes but you can have it as low as 1 minute by selecting the option “Once a minute”.

Now the fun part starts or I should say the core logic of this Bot.

Delete the existing code from the code editor window and paste the below-given code.

We are going to do some changes in the below code so that it works perfectly for you!

const lib = require('lib')({token: null /* link an account to create an identity */});const NomicsKey = "REPLACE THIS WITH YOUR NOMICS KEY"
const WebHook = "REPLACE THIS WITH YOUR DISCORD WEBHOOK"
let request = await lib.http.request['@1.1.5'].get({
url: `https://api.nomics.com/v1/currencies/ticker?key=${NomicsKey}&ids=DOGE&interval=1d,30d&convert=INR&per-page=100&page=1`
});
let result = await lib.http.request['@1.1.5'].post({
url: `${WebHook}`,
headers: {
'Content-Type': `application/x-www-form-urlencoded`
},
params: {
'content': `The price of Dogecoin (DOGE) is ${request.data[0].price}`,
'muteHttpExceptions': `true`
}
});

Now let’s go over what you need to REPLACE in the above code to get it working for you.

const NomicsKey = "REPLACE THIS WITH YOUR NOMICS KEY"

Simply remove the REPLACE message and paste the Key that you got from Nomics in your Email Id for the above field. You might have to manually enter your key in case it is getting changed while pasting it. (secret keys act this way sometimes.)

const WebHook = "REPLACE THIS WITH YOUR DISCORD WEBHOOK"

For this step, you need to open your Discord server and go to the “server settings”. In the server settings open the option named “integrations”.

Next click on the “Webhooks” option in the Integration menu.

Then in the Webhooks menu, you simply need to click on the “New Webhook” option and it will create a webhook bot for you. Now click on the option saying “Copy Webhook URL” as shown in the below image.

Now remove the REPLACE message and paste your webhook within the double quotes.

That’s All!
Your Discord Bot is almost ready to alert you with the latest Dogecoin price.

After filling both the fields simply click on “Save” and then “run”.
You will start to get Dogecoin Alerts in the Channel that you selected for the webhook in a while.

This Discord Bot can be used for all kinds of cryptocurrencies or even stocks. Explore the code and make changes according to your needs.

Reach out to me at https://twitter.com/Vinayak47427793 In case you are unable to set up the bot yourself.

To the moon!

--

--