A simple Discord Bot that uses the free CryptoCompare API to display cryptocurrency prices

Overview

What is this?

This is a simple Discord Bot coded in Python that uses the free CryptoCompare API to display cryptocurrency prices Discord Crypto Bot

Download

Use git to clone the repository or just download it as a ZIP

git clone https://github.com/kevintr303/Discord_Crypto_Bot

Installation

The only external Python libraries that are needed are:

pip3 install discord.py
pip3 install cryptocompare

Next, create your bot on Discord. Afterwards, you need to set the environment variables.

  • Set "CRYPTOCOMPARE_API_KEY" to your CryptoCompare api key which you can get here for free (100k calls monthly, 250k cap).
  • Next, set "TOKEN" to your Discord Bot's token.

Usage

In the script, there are some simple settings you can change:

# Settings:
base_command = "$cb"
bot_channel = "crypto_tracker"
# End of settings--

The base_command variable is the command people will use for the bot, and bot_channel is the name of the channel where the bot works. The main command of the bot: $cb will show all the current commands that exist. For ease I will also list the commands here: (make sure to have exact capitalization and formatting)

  1. $cb lists information and commands
  2. $cb [coin] [currency] Usage: $cb BTC USD Shows current price of a coin
  3. $cb history [coin] [currency] [date] Usage: $cb history BTC USD 2021,6,20 Shows historical price of a coin
  4. $cb coins Links to the CryptoCompare website that shows all coin types

Why did I make this?

Well, mostly for fun and as a learning experience. I wanted to create something that might be useful and thought, "hey, bitcoin's pretty popular right now. I should make a discord bot that tells you the current price," And so I did. This also marks my very first repository on GitHub(and first Discord bot). At the time of writing this, I have been learning Python for about 4-5 months now, so the code isn't the greatest.

What did I learn?

From this, I learned about environment variables and how to use them, how to create discord bots, github repositories and git, and event handling using Python decorators. That's a win if you ask me, to future projects we go! (Although I might revisit this in the future to improve on my code!)

License

MIT

You might also like...
Botto - A discord bot written in python that uses the hikari and lightbulb modules to make this bot

❓ About Botto Hi! This is botto, a discord bot written in python that uses the h

Discord bot code to stop users that are scamming with fake messages of free discord nitro on servers in order to steal users accounts.
Discord bot code to stop users that are scamming with fake messages of free discord nitro on servers in order to steal users accounts.

AntiScam Discord bot code to stop users that are scamming with fake messages of free discord nitro on servers in order to steal users accounts. How to

Discord bot to display private leaderboards for Advent of Code.
Discord bot to display private leaderboards for Advent of Code.

Advent Of Code Discord Bot Discord bot for displaying Advent of Code private leardboards, as well as custom leaderboards where participants can set th

WallAlley.bot is an open source and free to use financial discord bot originaly build for WallAlley server's community

WallAlley.bot About WallAlley.bot is an open source and free to use financial discord bot originaly build for WallAlley server's community. All data a

(unofficial) Googletrans: Free and Unlimited Google translate API for Python. Translates totally free of charge.

Googletrans Googletrans is a free and unlimited python library that implemented Google Translate API. This uses the Google Translate Ajax API to make

Upbit(업비트) Cryptocurrency Exchange OPEN API Client for Python
Upbit(업비트) Cryptocurrency Exchange OPEN API Client for Python

Base Repository Python Upbit Client Repository Upbit OPEN API Client @Author: uJhin @GitHub: https://github.com/uJhin/upbit-client/ @Officia

Jackrabbit Relay is an API endpoint for stock, forex and cryptocurrency exchanges that accept REST webhooks.

JackrabbitRelay Jackrabbit Relay is an API endpoint for stock, forex and cryptocurrency exchanges that accept REST webhooks. Disclaimer Please note RA

Utilizing the freqtrade high-frequency cryptocurrency trading framework to build and optimize trading strategies. The bot runs nonstop on a Rasberry Pi.
Utilizing the freqtrade high-frequency cryptocurrency trading framework to build and optimize trading strategies. The bot runs nonstop on a Rasberry Pi.

Freqtrade Strategy Repository Please test all scripts and dry run them before using them in live mode Contact me on discord if you have any questions!

Owner
Kevin
Kevin
Satoshi is a discord bot template in python using discord.py that allow you to track some live crypto prices with your own discord bot.

Satoshi ~ DiscordCryptoBot Satoshi is a simple python discord bot using discord.py that allow you to track your favorites cryptos prices with your own

Théo 2 Sep 15, 2022
Cryptocurrency Trading Bot - A trading bot to automate cryptocurrency trading strategies using Python, equipped with a basic GUI

Cryptocurrency Trading Bot - A trading bot to automate cryptocurrency trading strategies using Python, equipped with a basic GUI. Used REST and WebSocket API to connect to two of the most popular crypto exchanges in the world.

Francis 8 Sep 15, 2022
Cryptocurrency Prices Telegram Bot For Python

Cryptocurrency Prices Telegram Bot How to Run Set your telegram bot token as environment variable TELEGRAM_BOT_TOKEN: export TELEGRAM_BOT_TOKEN=<your_

Sina Nazem 3 Oct 31, 2022
Currency And Gold Prices - Currency And Gold Prices For Python

Currency_And_Gold_Prices Photos from the app New Update Show range Change better

Ali HemmatNia 4 Sep 19, 2022
Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency.

Elonbot Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency. Here is how it works: Subscribes to someone's (elonmusk?) tweets

null 153 Dec 23, 2022
A simple Discord bot wrote with Python. Kizmeow let you track your NFT project and display some useful information

Kizmeow-OpenSea-and-Etherscan-Discord-Bot 中文版 | English Ver A Discord bot wrote with Python. Kizmeow let you track your NFT project and display some u

Xeift 93 Dec 31, 2022
A Discord BOT that uses Google Sheets for storing the roles and permissions of a discord server.

Discord Role Manager Bot Role Manager is a discord BOT that utilizes Google Sheets for the organization of a server's hierarchy and permissions. Detai

Dion Rigatos 17 Oct 13, 2022
Discord bot ( discord.py ), uses pandas library from python for data-management.

Discord_bot A Best and the most easy-to-use Discord bot !! Some simple basic auto moderations, Chat functions. It includes a game similar to Casino, g

Jaitej 4 Aug 30, 2022
A Anything goes Discord bot written in python and uses the wrapper Discord.py

GerardTheWizard A Anything goes Discord bot written in python and uses the wrapper Discord.py What can he do? Allow users to level up through typing,

null 1 May 5, 2022
API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links

API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links

null 2 Dec 22, 2021