Skip to content

mohammedisa07/Cryptrix_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptrix - Zoho Cliq Crypto Bot

This is the backend for Cryptrix, a Zoho Cliq extension that provides real-time cryptocurrency prices, top coins, and conversions using the CoinMarketCap API.

🚀 Setup Instructions

1. Prerequisites

  • Node.js installed.
  • A CoinMarketCap API Key (Get a free one here).
  • Ngrok (or similar) to expose your local server to the internet.

2. Installation

  1. Navigate to the project directory:
    cd cryptrix-bot
  2. Install dependencies:
    npm install
  3. Configure environment variables:
    • Open .env file.
    • Replace YOUR_COINMARKETCAP_API_KEY_HERE with your actual API key.

3. Running the Server

Start the server:

node index.js

The server will run on http://localhost:3000.

4. Exposing to Internet (Required for Zoho Cliq)

Since Zoho Cliq needs to reach your server, use ngrok to create a public URL:

ngrok http 3000

Copy the HTTPS URL generated by ngrok (e.g., https://a1b2c3d4.ngrok.io).


🛠 Zoho Cliq Configuration

Now, connect your bot in the Zoho Cliq Developer Console.

Step 1: Create the Bot

  1. Go to Zoho Cliq Developer Portal.
  2. Click Create Bot.
    • Name: Cryptrix
    • Unique Name: cryptrix_bot
    • Access: Personal or Organization.
    • Save.

Step 2: Create Slash Commands

You need to create 3 commands. For each command, select Execution Type as Webhook / URL.

Command 1: /price

  • Command Name: price
  • Hint: Get price of a coin (e.g., BTC)
  • URL: YOUR_NGROK_URL/price (e.g., https://a1b2c3d4.ngrok.io/price)
  • Method: POST

Command 2: /top

  • Command Name: top
  • Hint: Get top N coins
  • URL: YOUR_NGROK_URL/top
  • Method: POST

Command 3: /convert

  • Command Name: convert
  • Hint: Convert crypto (e.g., 1 BTC USD)
  • URL: YOUR_NGROK_URL/convert
  • Method: POST

Step 3: Test It!

  1. Go to any chat in Zoho Cliq.
  2. Type /price BTC.
  3. You should see a rich card with the current Bitcoin price!

📝 API Reference

  • POST /price: Expects text or arguments with symbol (e.g., "ETH").
  • POST /top: Expects text or arguments with number (e.g., "10").
  • POST /convert: Expects text or arguments with amount, symbol, target (e.g., "100 DOGE USD").

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors