Live stock tickers for your discord server.
Love these bots? You can support this project by subscribing to the premium version or maybe buy me a coffee or hire me to write/host your discord bot!
Don't see a stock or crypto that you need? Join our discord or open a github issue to get new ones added!
WARNING: Due to an increase in usage, I am having to verify some bots. Discord is experiancing an influx in verification requests and thus there may be some bots that you are unable to add until the bot is verified. You can either try again later or join the discord to get alerted when these bots become requestable again.
For advanced features like faster update times and color changing names on price changes you can subscribe to my premuim offering. I will host individual instances for your discord server at a cost of $5/month for a 5 pack of bots. You can choose a mix of cryptos and stocks and cancel at any time.
There is a full logging stack that includes loki & promtail with grafana for visualization.
If you are interested please see the contact info on my github page and send me a messgae via your platform of choice (discord perferred). For a live demo, join the support discord linked at the top or bottom of this page.
Install python for your target operating system.
Clone down the repo locally:
git clone [email protected]:rssnyder/discord-stock-ticker.git && cd discord-stock-ticker
Register a new application in the discord developer portal and copy the bot token:
export DISCORD_BOT_TOKEN=<token>
If you are watching a stock, enter the ticker symbol, and optionally you can set a custom name to appear instead of the symbol:
export TICKER=AAPL
export STOCK_NAME=Apple
If you are watching a crypto, enter the coin name as you want it to appear on your ticker, as well as the coin name/id for the coingecko API:
export TICKER=BTC
export CRYPTO_NAME=bitcoin
You can see coingecko coin names/id via their API (or enter the url in your browser):
curl -X GET "https://api.coingecko.com/api/v3/coins/list" -H "accept: application/json"
You can optionally give your bot "change nickname" permissions to get around discord's limit on changing names only twice per two hours. Then you can set a custom amount of time between price updates (in seconds):
You must also make sure your bot has Change Nickname
permissions to your server.
export SET_NICKNAME=1
export FREQUENCY=3
To enable color changing on price change, there is some setup needed. First you must create a new role to place the bots in. You need to check the Display role members seperatly from other online members
option for this role, and do not assign a custom color for this role, leave it default.
Next you must create two roles called tickers-green
and tickers-red
. Do not check the Display role members seperatly from other online members
option, but do set the colors for these roles to be green
and red
accordingly (or choose your own colors). These two new roles must appear below the general ticker role you created in the first step in the roles list.
You must also make sure your bot has Manage Roles
permissions to your server.
Lastly, to enable the color changing, set SET_COLOR=1
in your environment:
export SET_COLOR=1
The colors will reflect the day price change, red for a loss and green for a gain. To flash the color of the price change every check (red for price decrease, green for increase) you can set FLASH_CHANGE
:
export FLASH_CHANGE=1
Other options:
export LOG_FILE=log.log # log to file instead of stdout
export POST_MARKET_PRICE=3 # display post market price instead of difference
Once all your options are set, simply install the dependencies and run the bot (virtual environments might be a smart idea):
pip3 install -r requirements.txt
python3 main.py
You can also run these bots using docker. This can make running multiple bots esier. Here is an example docker compose file for the basic feature set (please check for the latest release and update the tags accordingly):
---
version: "2"
services:
ticker-pfg:
image: ghcr.io/rssnyder/discord-stock-ticker:1.6.0
container_name: discord-stock-ticker
environment:
- DISCORD_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- TICKER=PFG
restart: unless-stopped
ticker-aapl:
image: ghcr.io/rssnyder/discord-stock-ticker:1.6.0
container_name: discord-stock-ticker
environment:
- DISCORD_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- TICKER=AAPL
restart: unless-stopped
And here is an example of enabling faster updates with color changes:
---
version: "2"
services:
ticker-pfg:
image: ghcr.io/rssnyder/discord-stock-ticker:1.6.0
container_name: discord-stock-ticker
environment:
- DISCORD_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- TICKER=PFG
- SET_NICKNAME=1
- SET_COLOR=1
- FREQUENCY=10
restart: unless-stopped
ticker-aapl:
image: ghcr.io/rssnyder/discord-stock-ticker:1.6.0
container_name: discord-stock-ticker
environment:
- DISCORD_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- TICKER=AAPL
- SET_NICKNAME=1
- SET_COLOR=1
- FREQUENCY=10
restart: unless-stopped
docker-compose-up -d
If you have a request for a new ticker or issues with a current one, please open a github issue or find me on discord at jonesbooned#1111
or join the support server.
Love these bots? Maybe buy me a coffee! Or send some crypto to help keep these bots running:
eth: 0x27B6896cC68838bc8adE6407C8283a214ecD4ffE
doge: DTWkUvFakt12yUEssTbdCe2R7TepExBA2G
bch: qrnmprfh5e77lzdpalczdu839uhvrravlvfr5nwupr
btc: 1N84bLSVKPZBHKYjHp8QtvPgRJfRbtNKHQ