

- Website monitor discord bot how to#
- Website monitor discord bot install#
- Website monitor discord bot update#
- Website monitor discord bot full#
- Website monitor discord bot plus#
Website monitor discord bot update#
Next, we will update the bot.js script to use the Ethers.js library to detect smart contract events on-chain then log a message on the console.īefore we get started with writing the code for this step we will need a few things. node bot.js Step 4: Use Ethers.js to Monitor Smart Contract Events

Run the bot.js file inside the “smart-contract-discord-bot” directory with the following command, and you should see the Alchemy URL including the API key printed in the console.
Website monitor discord bot install#
npm install -save dotenvĪfter this is complete, go into the bot.js file and make the following changes. env file in your project, you will need to download the dotenv library with the following command inside your “smart-contract-discord-bot” directory. env with the following, replacing YOUR-API-KEY with your real Alchemy API key: ALCHEMY_URL= Then click continue and select Let’s Go.Ĭopy this API key, then create a file called “.env” inside the “smart-contract-discord-bot” directory. You can skip entering a credit card, then select the “Capped Capacity” option. In my example, I will select Polygon Mainnet. Then click “Get Started”.Įnter a Team Name, enter an App Name, then select the Network where your smart contract is deployed. I will use Alchemy for the purposes of this tutorial.įirst, you will need to sign up for an account at Alchemy at īecause I will be monitoring a smart contract on the Polygon network, for the ecosystem, I will select the “Ethereum Including L2s” option.
Website monitor discord bot full#
Rather than running a full node on the same machine that you have your discord bot running, you can instead use the API access provided by companies like Alchemy and Infura to connect to the blockchain. When listening to smart contract events on the blockchain, you will need a way to connect to the blockchain. npm install -save discord.js Step 3: Create an Alchemy API Key Install Ethers.js with npm by using the following command inside the “smart-contract-discord-bot” directory.

Then you can create your node project by creating a new directory with the name “smart-contract-discord-bot”, then create a file inside with the name “bot.js”. If you don’t have Nodejs installed on your system, it can be downloaded at and then installed on your computer. Step 2: Setup your Nodejs project with Ethers.js and Discord JS Libraries That’s it, now you have your Discord server. Select this button to start creating a new server.Įnter a server name, then select the “Create” button.
Website monitor discord bot plus#
On Discord in the browser or via the Discord application downloadable at, scroll to the bottom of the screen, then in the bottom right corner, you will see a button with the plus symbol. You can skip this step if you already have a Discord server.īut if you don’t have a Discord server, it is very easy to create one.
Website monitor discord bot how to#
In this tutorial, I will walk you through how to create a bot like this, that monitors a smart contract for events and posts a message to Discord when a particular event occurs on-chain.Īll of the code written in this tutorial will be available on GitHub at: Join the Guild Gotchi Rental Program: /P5pFZD2dUw- WAGMI Warriors March 28, 2022 If you have joined the Guild Gotchi Rental Program, you will see the bot automatically post new Gotchi rental listings that are using the guild treasury. The Discord bot for tracking guild rentals is now live.
