Launch your bitcoin ordinal discord community with QuickNode

Launch your bitcoin ordinal discord community with QuickNode

Overview

We know Bitcoin was the first popular network to have value in a decentralized way. The initial idea behind Bitcoin was to combat the bad practices in the financial ecosystem. Now we can even store images and videos! However, there are two sides to the coin: those who support this idea and the maximalists who seek to preserve Bitcoin's original essence.

In this guide, we will accomplish implementing tools to quickly identify the owner of an Ordinal and view the image within the same Discord community. With these tools, you can develop a Bitcoin-ordinal gated community!

Discord Bitcoin Ordinal Bot

What We Will Do

  • Setting up our bot service to fetch data from QuickNode.

What You Will Need

What is QuickNode?

QuickNode is a platform designed for everyione. It enables teams to create and expand blockchain applications. QuickNode offers tools specifically for dApp development and provides access to over 30 chains and 35 networks!.

Their infrastructure includes features like real-time data delivery, event alerts, and comprehensive support for multiple blockchains.

What is Discord?

Discord is a popular way for people, even those as young as 13, to talk to each other using voice, video, and messages. Lots of people use it to chat with friends and groups. You can have fun chats, plan games, work together on projects, or just stay in touch with people who share your interests.

Discord is like a flexible hub for different types of talking and hanging out.

Creation of our discordbot

To activate your Discord bot, you will need two specific values: CLIENT_PUBLIC_KEY and BOT_TOKEN, please save these values, we will need them in this section: "Creating a service to retrieve information for ourDiscordbot".

Here are the steps to obtain these values:

Go to the Discord Developer Portal website. You can access it by visiting discord.com/developers/applications and logging in with your Discord account.

  1. Once you are logged in, click on the "New Application" button to create a new application for your bot. Give your application a name that represents your bot.

    Creating a discord bot

  2. In the left sidebar, select "Bot" under the settings for your application.

  3. Under the "Token" section, you will find your BOT_TOKEN.

  4. Click on the "Reset Token" button.

    Discord Bot Token

  5. This token acts as your bot's authentication to the Discord API. Keep this token secure and do not share it publicly.

  6. To obtain the CLIENT_PUBLIC_KEY, you need to go to the General Information setting. Search for "Public Key" and copy the value.

    Discord Bot Client Public Key

  7. After that, you need to invite your bot to your discord, to get the invitation, go to the "OAuth2" section and search for the "URL Generator" sub-section.

  8. In this section, you need to check the "bot" and "applications.commands" options. After that, you can see the Bot Permissions, and check the "Administrator" option.

    Generating an invitation to invite our Discord bot to our community

  9. At the bottom, you need to copy this invitation URL.

  10. Discord invitation URL

    In consequence, you need to copy the generated URL and paste it into your browser, and press enter:

    Accepting our discord bot on our server

  11. You will see a similar screen to the previous image and finally, you can see your bot on your community.

    Bot as Member in our community

  12. To retrieve the information from our discord bot, you need to create this command:

    1. /info <ordinalid>

      1. You can retrieve the ordinal information.

        Discord bot info command

  13. To create the commands, you need to go to:
    https://www.site24x7.com/tools/restapi-tester.html

    1. Creating the command "/info":

      Creating the command "/info" on https://www.site24x7.com/tools/restapi-tester.html

      1. In "Method", you need to change the option to "POST"

      2. In "Rest API Endpoint", you need to copy this URL and change the "Application ID" for the parameter returned in the following steps above:

        1. discord.com/api/v10/applications/[APPLICATION ID]/commands
      3. In "Post Data" you need to check the "JSON" parameter.

        1. Verify if the "raw" option is selected.

        2. Copy this code and paste it as in the image above.

           {
               "name": "info",
               "description": "Retrieve your ordinal",
               "options": [
                   {
                       "name": "ordinalid",
                       "description": "OrdinalId",
                       "type": 3,
                       "required": true
                   }
               ]
           }
          
      4. In "Custom Headers" you need to check the "Yes" parameter.

        1. You will see two fields "Name" and "Value".

          1. In Name, write "Authorization".

          2. In Value, Bot <Token>.

            1. You need to change it with the parameter returned in the steps mentioned above.
      5. Click on the "Test again" button.

      6. To view the response to this petition, you can scroll down.

        Response body from "/info" command

  14. Obtaining information from QuickNode

Obtaining QUICKNODE_RPC_URL value:

Click on the "Create Endpoint" button.

Screenshot of the QuickNode platform for creating your RPC endpoint

You need to select the Bitcoin Chain:

Screenshot of the QuickNode platform to select the desired blockchain to obtain our RPC

And please select the Mainnet network.

Screenshot of the QuickNode platform to select the desired version of the blockchain

After that, activate the add-on Ordinals & Runes API.

Screenshot of the QuickNode platform where we activate the Ordinals&Runes plugin

Save the HTTP Provider URL.

Screenshot of the QuickNode platform to copy our RPC from the desired blockchain

Creating a service to retrieve information for our Discord bot

You need to go to Render:

Render Dashboard

Afterward, you need to click on "New". In the subsequent steps, you will need to click on the 'Web Service' option.

WebService option on render.com

You will see this dashboard:

Dashboard from render.com to obtain the code from the bot, and subsequently, perform the necessary configuration tasks

In the Public Git Repository section, you can find a white box where you need to paste this code and click on the "Continue" button:

https://github.com/irwingtello/ordinalfam

Configuring environment variables on render.com

You need to change these values:

  • In Name, you need to write a name for the service.

  • In Build Command, you need to write the next command "npm install".

After defining the above values, we need to scroll down and click on the "Advanced" button.

You need to add the following environment variables :

  • QUICKNODE_RPC_URL.

  • CLIENT_PUBLIC_KEY.

  • BOT_TOKEN.

Configuring our bot environment variables

Afterward, click on the "Create Web Service" button and you will see the next screen.

Congratulations!. You now have your first bot service online. We need to copy the URL for this bot and paste it into our bot configuration on Discord.

In my case, this is my URL:

https://ordinalfam.onrender.com

Setting up our service on Discord

I will save you time!, you need to go to the Discord Developer Portal:

https://discord.com/developers/applications/

Click on the name of your Bot.

Discord Developer Portal

After that, you need to go to the "General Information" section and change the "Interactions Endpoint URL".

You need to paste the URL generated by render.com and add the path "/interactions"

Example:
https://ordinalfam.onrender.com/interactions

Discord Developer Portal, General Information

In the consequent step, you need to click the button "Save changes".

After that, you can use your bot in your community!

Exploring your first discordbot on your community

Go to any channel in your discord and type this command: /info, to discover the ordinal information.

How to use the info command related to the Ordinal Discord bot

After that, you will see this result:

Results from the info command related to the Ordinal Discord bot

Conclusion

Congratulations! 🎉 You’ve successfully retrieved information about a Bitcoin Ordinal in your Discord community! 🤖✨

You can enhance the bot’s capabilities by adding a feature to retrieve all the holders from your community. 🙌

I’ve also hidden a secret Easter egg that provides hints for expanding the bot even further—beyond your imagination! 🐣🔍

For more details on the method used in this tutorial, check out the link below:
https://www.quicknode.com/docs/bitcoin/ord_getInscription

We ❤️ Feedback!

If you have any feedback or questions on this guide, let us know. Or, feel free to reach out to us via Twitter or our Discord community server.

We’d love to hear from you!

Author: Irwing Tello
Discord: discord.com/invite/ADjtsHVreT Twitter: twitter.com/irwingtello LinkedIn: linkedin.com/in/irwingtello Email:
Website: dfhcommunity.com
Youtube: youtube.com/@irwingtellomx

You can support my work here:
buymeacoffee.com/irwingtello

BTC: 34kXK9CpTJP1PyHKw2kUD2bt6rtGcG5CHY
EVM Address: 0x8B98F8Ff69d2A720120eD6C71A9Bc5072b8Eb46D
Solana: Ey9oVFHW79giacRZaKxigYjeihMsY7ox8jxc7Hp1sJmS

Did you find this article valuable?

Support Irwing Tello by becoming a sponsor. Any amount is appreciated!