Endogen / OpenCryptoBot

Telegram bot to access various information about crypto-currencies
GNU Affero General Public License v3.0
126 stars 55 forks source link
bot coin crypto currency information python3 telegram whale

OpenCryptoBot

Welcome to the Swiss Army knife for crypto! OpenCryptoBot is an open source Telegram bot written in Python and you can add this bot directly or add him by searching for user @OpenCryptoBot on Telegram.

If you are interested in news regarding this bot or want more indept explanations for all available commands, please visit the homepage.

Overview

This Python script is a polling based Telegram bot. Webhook mode is implemented but untested.

General bot features

Command features

Configuration

This part is only relevant if you want to host this bot yourself. If you just want to use the bot, add user @OpenCryptoBot to your Telegram contacts.

Before starting up the bot you have to take care of some settings and add some API tokens. All configuration files or token files are located in the conf folder.

config.json

This file holds the configuration for the bot. You have to at least edit the value for __admin_id__. Every else setting is optional.

bot.token

This file holds the Telegram bot token. You have to provide one and you will get it in a conversation with Telegram user @BotFather while registering your bot.

cryptopanic.token

This file is optional and only needed if you use the news plugin. News are requested from http://cryptopanic.com and thus you have to register an account there and get you API token and enter it in here.

Starting

In order to run the bot you need to execute some Python code. If you don't have any idea where to host the bot, take a look at Where to host Telegram Bots. But services like Heroku (free) will work fine too. You can also run the script locally on your own computer for testing purposes.

Prerequisites

Python version

You have to use at least Python 3.7 to execute the scripts. Everything else is not supported.

Installing needed modules from Pipfile

Install all needed Python modules automatically with Pipenv. You have to be in the root folder of the bot - on the same level as the Pipfile:

pipenv install
Installing needed modules from requirements.txt

This is an alternative way to install all needed Python modules. If done this way, every installed module will be available for every other Python script you run. Installing modules globally is only recommanded if you know what you are doing:

  1. Generate requirements.txt from Pipfile
pipenv lock -r
  1. Install all needed Python modules
pip3 install -r requirements.txt
Installing orca

After you installed the modules, you also have to install orca if you want to use the candlestick plugin or the chart plugin (because Plotly is used to generate the static charts and orca is a dependency for static image generation under Plotly). For more info check out Plotly Static Image Export

If you get error xvfb-run: error:Xvfb failed to start please execute:

xvfb-run -a /path/to/orca "$@"

Starting

  1. First you have to make the script run.sh executable with
chmod +x run.sh
  1. If you installed the needed Python modules via Pipfile you have to execute the following in the root folder of the bot:
pipenv run ./run.sh &

If you installed the modules globally:

./run.sh &

Stopping

The recommanded way to stop the bot is the bot command /shutdown. If you don't want or can't use this, you can shut the bot down with:

pkill python3.7

which will kill every Python 3.7 process that is currently running.

Usage

If you configured the bot correctly and execute it, the bot will check for updates (if enabled in config.json) and notify you if a new release is available. Please ignore the update if you purposely downloaded the newest version from the master branch because the bot will only notify you about releases. And in this case the release will be older then the current version from the master branch.

Available commands

Charts
/c - Chart with price and volume
/cs - Candlestick chart for coin
Price
/51 - PoW 51% attack cost
/ath - All time high price for coin
/best - Best movers for hour or day
/ch - Price change over time
/ico - ICO info for coin
/p - Coin price
/roi - Return on Investment for a coin
/s - Price, market cap and volume
/v - Value of coin quantity
/worst - Worst movers for hour or day
General
/comp - Compare coins
/de - Show decentralization info
/des - Coin description
/dev - Development information
/ex - Exchange details and toplist
/g - Global crypto data
/i - General coin information
/m - Find exchanges to trade a coin
/pe - Info about person from a team
/re - Repeat any command periodically
/se - Search for symbol by coin name
/t - Info about team behind a coin
/top - List top 30 coins
/tr - Google Trends - Interest Over Time
/wp - Find whitepaper for a coin
News & Events
/ev - Show crypto events
/n - News about a coin
/soc - Social media details
/tw - Latest Tweets from Twitter
Utilities
/po - Info about mining pools
/wa - Details about wallets
Bot
/about - Information about bot
/bpmn - BPMN diagram for a command
/feedback - Send us your feedback
/man - Show how to use a command
/re - Repeat any command periodically

If you want to show a list of available commands as you type, open a chat with Telegram user @BotFather and send the command /setcommands. Then choose the bot you want to activate the list for and after that send the list of commands with description. Something like this:

51 - PoW 51% attack cost
about - Information about bot
ath - All time high price for coin
best - Best movers for hour or day
bpmn - BPMN diagram for a command
c - Chart with price and volume
ch - Price change over time
comp - Compare coins
cs - Candlestick chart for coin
de - Show decentralization info
des - Coin description
dev - Development information
ev - Show crypto events
ex - Exchange details and toplist
feedback - Send us your feedback
g - Global crypto data
h - Show overview of all commands
i - General coin information
ico - ICO info for coin
m - Find exchanges to trade a coin
man - Show how to use a command
mc - Market capitalization
n - News about a coin
p - Coin price
pe - Info about person from a team
po - Info about mining pools
re - Repeat any command periodically
roi - Return on Investment for a coin
s - Price, market cap and volume
se - Search for symbol by coin name
soc - Social media details
t - Info about team behind a coin
top - List top 30 coins
tr - Google Trends - Interest Over Time
tw - Get newest tweets for coin
v - Value of coin quantity
vol - Volume for a coin
wa - Details about wallets
worst - Worst movers for hour or day
wp - Find whitepaper for a coin

Development

I am actively developing this bot and will do so also in the near future. If you would like to help out with development, send a message via Telegram to @endogen or open an issue here at GitHub.

Todo

Priority 1
Priority 2
Priority 3

Disclaimer

I use this bot personally to check the current state of some coins but since all the data is relying on external APIs, i can't guarantee that all informations are correct. Please use with caution. I can't be held responsible for anything!

Donating

If you find OpenCryptoBot suitable for your needs, please consider donating whatever amount you like to:

Bitcoin

1EoBYmfdJznJ21v8Uiiv44iJ2sDb6Bsqc1

Bitcoin Cash

qzken7mgslv0w9t4ycj4uganv66ljccsq5ngcepp6h

Ethereum (ETH)

0x15c3dB6f0f3cC3A187Cfa4b20605293a08b9Be46

Monero (XMR)

42eSjjHF63P3LtxcdeC71TT3ZCcGbTtk1aESTvfrz4VqYeKMFP9tbWhjmcUJZE3yVrgDjH8uZhnob9czCtm764cFDWYPe7c

How else can you support me?

If you can't or don't want to donate, please consider signing up on listed exchanges below. They are really good and by using these links to register an account i get a share of the trading-fee that you pay to the exchange if you execute a trade.