Introducing: A Discord Crypto Ticker Bot based on CryptoBridge API

Repository

https://github.com/gluneau/discord-crypto-bot

New Project

After being on the discord server of CryptoBridge, I noticed the Price Bots they had, I was inspired. A neet idea and a cool service for a coin. I contacted the team and was able to obtain the source code of the original bot used thanks to stepollo from crypto-bridge.org.

I then refactored the code, coalesced all prices into one bot and made it generic so that anyone who wants to add this bot to their discord server can with minimal configuration of the environment variables in .env file.

From here I was able to find the right match in the array of exchange pairs and get our token values.

And then we get the fiat values from here, all in BTC

We need to do some calculation around volume, then format all the strings we want the bot to report.

Finally we loop around and display each statistic after another with the sleep time requested.

Once this is done, it starts again, fetches the API one more time and does its thing, displays the newly acquired data.

Here is the results in an animated gif with 15 seconds interval:

Install instructions from the README.md

Installing the prerequisites

sudo apt install python-pip
pip install pipenv

Installing the bot:

git clone https://github.com/gluneau/discord-crypto-bot.git
cd discord-crypto-bot
pipenv install

Here is a proposed sample for your .env file:

YOURDISCORDTOKEN=Nxxxxxxxxxxxxxxxxxxxxxx4.Dxxxxw.mxxxxxxxxxxxxxxxxxxxxxxxxxk
BOTSLEEP=15
BOTPAIR=STONE_BTC
BOTFIAT=USD

Running the bot

pipenv run python3 bot.py

Technology Stack

  • Python3
  • Pipenv

Roadmap

It depends of the community requests, I will implement new features as they come up.

How to contribute

Simple! 1. fork, 2. modify, 3. submit a pull request to the official repository.

Proof of work

About Discord

Discord is an all-in-one voice and text chat for gamers (and crypto enthusiasts obviously!) that's free, secure, and works on both your desktop and phone.

Create your app and bot right here:

To add your new bot to a server you administer, replace the place holder with your client id and go:

About CryptoBridge

CryptoBridge is a decentralized exchange (DEX) that supports trading of most popular tokens & altcoins. In the hands of BridgeCoin Holders. Built on the Bitshares(BTS) CryptoBrigde’s order book, trades and accounts are completely decentralized. CryptoBridge can be access by anyone with internet access 24/7. Trading never stops.

About StoneCoin

STONE is a rock solid, feature rich cryptocurrency ecosystem. A group of ambitious community members banded together and began implementing their skills to revive the coin after being abandoned by the original developer. The choice to rebuild the infrastructure was easy due to the coin having been listed on two exchanges and the core built on an older Dash core that was widely known and easy to understand.

Thanks to @jedigeiss and @venalbe for their fantastic interview about StoneCoin and introduction to the project.

The bot is running on their Discord Server.

GitHub Account

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center