Live stock and crypto tickers for your discord server.
Now with five different types of tickers!
🍾 400+ public tickers with over 15k installs across 3k discord servers!
Are you just looking to add free tickers to your discord server? Click the discord icon below to join the support server and get the list of avalible bots!
- discord-stock-ticker
- Contents
- Preview
- Join the discord server
- Support this project
- Add free tickers to your servers
- Premium
- Self-Hosting - Docker
- Self-Hosting - binary
- Stock and Crypto Price Tickers
- Crypto Market Cap
- Stock and Crypto Price Tickerboards
- Ethereum, BSC, and Polygon Gas Prices
- Ethereum, BSC, or Polygon Token Holders
- ETH/BSC/MATIC Token Price
- Kubernetes
- Louie
Love these bots? You can support this project by subscribing to the premium version, buying me a coffee, using my digital ocean referral link, or hiring me to write or host your discord bot!
For advanced features like faster update times and color changing names on price changes you can subscribe to my premuim offering.
Price per bot (paid monthly): $1 Price per bot (paid yearly): $10
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.
mattn/go-sqlite3
to store state. Since this is a CGO package cross-compilation is more difficult. Because of this running on non linux-x86 machines may require you to build from source. I am currently working on publishing offical builds again for other OS/ARCH and will remove this warning when the work has been completed.
Grab the current release number from the release page and expose your designated API port:
docker run -p "8080:8080" ghcr.io/rssnyder/discord-stock-ticker:3.4.1
You can set the config via ENV vars, since we use namsral/flag the variables are the same as the flag inputs, but all uppercase:
When using the binary...
-address="localhost:8080": address:port to bind http server to.
-cache=false: enable cache for coingecko
-db="": file to store tickers in
-frequency=0: set frequency for all tickers
-logLevel=0: defines the log level. 0=production builds. 1=dev builds.
-redisAddress="localhost:6379": address:port for redis server.
-redisDB=0: redis db to use
-redisPassword="": redis password
When using env (docker)...
export ADDRESS="localhost:8080" # address:port to bind http server to.
export CACHE=false # enable cache for coingecko
export DB="" # file to store tickers in
export FREQUENCY=60 # set frequency for all tickers
export LOGLEVEL=0 # defines the log level. 0=production builds. 1=dev builds.
export REDISADDRESS="localhost:6379" # address:port for redis server.
export REDISDB=0 # redis db to use
export REDISPASSWORD="" # redis password
docker run -p "8080:8080" --env CACHE=true ghcr.io/rssnyder/discord-stock-ticker:3.4.1
Then you can pass a volume to store the state (and at the same time, upgrade to using docker-compose):
---
version: "3"
services:
discordstockticker:
image: ghcr.io/rssnyder/discord-stock-ticker:3.4.1
environment:
- DB=/dst.db
- CACHE=true
volumes:
- /home/infra/dst.db:/dst.db
ports:
- "8112:8080"
mattn/go-sqlite3
to store state. Since this is a CGO package cross-compilation is more difficult. Because of this running on non linux-x86 machines may require you to build from source. I am currently working on publishing offical builds again for other OS/ARCH and will remove this warning when the work has been completed.
This bot is distributed as a docker image and a binary.
The program acts as a manager of one to many bots. You can have one running instance of the program and have any number of bots running within it.
Click here to watch a quick video tutorial on how to self-host these bots on linux.
To enable color changing you will need to create three roles.
The first role is the role the tickers will appear under. It can be named anything you want. You need to check the Display role members seperatly from other online members option for this role, but do not assign a custom color for this role, leave it default.
Then you need to make two other roles. These roles need to be named exactly tickers-red & tickers-green. Do not check the Display role members seperatly from other online members option for these roles, but do assign colors to these roles, red and green (or whatever color you want to represent gain/loss) respectively.
The last two roles tickers-green and tickers-red need to be below the first role in the role list in your server settings. You should then add all your ticker bots to the first role.
Pull down the latest release for your OS here.
wget https://github.com/rssnyder/discord-stock-ticker/releases/download/v2.0.0/discord-stock-ticker-v3.3.0-linux-amd64.tar.gz
tar zxf discord-stock-ticker-v3.3.0-linux-amd64.tar.gz
./discord-stock-ticker
There are options you can set for the service using flags:
-address="localhost:8080": address:port to bind http server to.
-cache=false: enable cache for coingecko
-db="": file to store tickers in
-frequency=0: set frequency for all tickers
-logLevel=0: defines the log level. 0=production builds. 1=dev builds.
-redisAddress="localhost:6379": address:port for redis server.
-redisDB=0: redis db to use
-redisPassword="": redis password
The script here (ran as root) will download and install a discord-stock-ticker
service on your linux machine with an API avalible on port 8080
to manage bots.
wget https://github.com/rssnyder/discord-stock-ticker/releases/download/v3.3.0/discord-stock-ticker-v3.3.0-linux-amd64.tar.gz
tar zxf discord-stock-ticker-v3.3.0-linux-amd64.tar.gz
mkdir -p /etc/discord-stock-ticker
mv discord-stock-ticker /etc/discord-stock-ticker/
wget https://raw.githubusercontent.com/rssnyder/discord-stock-ticker/master/discord-stock-ticker.service
mv discord-stock-ticker.service /etc/systemd/system/
systemctl daemon-reload
systemctl start discord-stock-ticker.service
If you need to make modifications to the setting of the service, just edit the /etc/systemd/system/discord-stock-ticker.service
file on the line with ExecStart=
.
Now that you have the service running, you can add bots using the API exposed on the addres and port that the service runs on (this address is shown when you start the service).
curl localhost:8080/ticker
Stock Payload:
{
"ticker": "pfg", # string: symbol for the stock from yahoo finance
"name": "2) PFG", # string/OPTIONAL: overwrites display name of bot
"set_color": true, # bool/OPTIONAL: requires set_nickname
"decorator": "@", # string/OPTIONAL: what to show instead of arrows
"currency": "aud", # string/OPTIONAL: alternative curreny
"activity": "Hello;Its;Me", # string/OPTIONAL: list of strings to show in activity section
"set_nickname": true, # bool/OPTIONAL: display information in nickname vs activity
"frequency": 10, # int/OPTIONAL: seconds between refresh
"twelve_data_key": "xxx", # string/OPTIONAL: use twelve data as source, pass in api key
"discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx" # string: dicord bot token
}
Crypto Payload:
{
"name": "bitcoin", # string: name of the crypto from coingecko
"crypto": true, # bool: always true for crypto
"ticker": "1) BTC", # string/OPTIONAL: overwrites display name of bot
"set_color": true, # bool/OPTIONAL: requires set_nickname
"decorator": "@", # string/OPTIONAL: what to show instead of arrows
"currency": "aud", # string/OPTIONAL: alternative curreny
"currency_sumbol": "AUD", # string/OPTIONAL: alternative curreny symbol
"pair": "binancecoin", # string/OPTIONAL: pair the coin with another coin, replaces activity section
"pair_flip": true, # bool/OPTIONAL: show <pair>/<coin> rather than <coin>/<pair>
"activity": "Hello;Its;Me", # string/OPTIONAL: list of strings to show in activity section
"decimals": 3, # int/OPTIONAL: set number of decimal places
"set_nickname": true, # bool/OPTIONAL: display information in nickname vs activity
"frequency": 10, # int/OPTIONAL: seconds between refresh
"discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx" # string: dicord bot token
}
Example:
curl -X POST -H "Content-Type: application/json" --data '{
"ticker": "pfg",
"name": "PFG",
"discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxxx"
}' localhost:8080/ticker
curl -X PATCH localhost:8080/ticker/pfg
curl -X PATCH localhost:8080/ticker/bitcoin
curl -X DELETE localhost:8080/ticker/pfg
curl -X DELETE localhost:8080/ticker/bitcoin
curl localhost:8080/marketcap
{
"name": "bitcoin", # string: name of the crypto from coingecko
"ticker": "1) BTC", # string/OPTIONAL: overwrites display name of bot
"set_color": true, # bool/OPTIONAL: requires set_nickname
"decorator": "@", # string/OPTIONAL: what to show instead of arrows
"currency": "aud", # string/OPTIONAL: alternative curreny
"currency_sumbol": "AUD", # string/OPTIONAL: alternative curreny symbol
"activity": "Hello;Its;Me", # string/OPTIONAL: list of strings to show in activity section
"decimals": 3, # int/OPTIONAL: set number of decimal places
"set_nickname": true, # bool/OPTIONAL: display information in nickname vs activity
"frequency": 10, # int/OPTIONAL: seconds between refresh
"discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx" # string: dicord bot token
}
Example:
curl -X POST -H "Content-Type: application/json" --data '{
"name": "bitcoin",
"discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxxx"
}' localhost:8080/marketcap
curl -X PATCH localhost:8080/marketcap/bitcoin
curl -X DELETE localhost:8080/marketcap/bitcoin
Tickerboards are tickers that rotate though several stocks or cryptos. This bot is a newer release, and is not as stable as the rest of the bots.
curl localhost:8080/tickerboard
Stock Payload:
{
"name": "Stocks", # string: name of your board
"items": ["PFG", "GME", "AMC"], # list of strings: symbols from yahoo finance to rotate through
"header": "1. ", # string/OPTIONAL: adds a header to the nickname to help sort bots
"set_color": true, # bool/OPTIONAL: requires set_nickname
"arrows": true, # bool/OPTIONAL: show arrows in ticker names
"set_nickname": true, # bool/OPTIONAL: display information in nickname vs activity
"frequency": 10, # int/OPTIONAL: seconds between refresh
"discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx" # string: dicord bot token
}
Crypto Payload:
{
"name": "Cryptos", # string: name of your board
"crypto": true, # bool: always true for crypto
"items": ["bitcoin", "ethereum", "dogecoin"], # list of strings: names from coingecko to rotate through
"header": "2. ", # string/OPTIONAL: adds a header to the nickname to help sort bots
"set_color": true, # bool/OPTIONAL: requires set_nickname
"arrows": true, # bool/OPTIONAL: show arrows in ticker names
"set_nickname": true, # bool/OPTIONAL: display information in nickname vs activity
"frequency": 10, # int/OPTIONAL: seconds between refresh
"discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx" # string: dicord bot token
}
Example:
curl -X POST -H "Content-Type: application/json" --data '{
"name": "Stocks",
"frequency": 3,
"set_nickname": true,
"set_color": true,
"percentage": true,
"arrows": true,
"discord_bot_token": "xxxxxxx",
"items": ["PFG", "GME", "AMC"]
}' localhost:8080/tickerboard
curl -X PATCH localhost:8080/tickerboard/stocks
curl -X DELETE localhost:8080/tickerboard/stocks
These bots shows the current recommended gas prices for three types of transactions. You can choose either the ethereum, binance smart chain, or polygon blockchain.
curl localhost:8080/gas
Payload:
{
"network": "ethereum", # string: one of: ethereum, binance-smart-chain, or polygon
"set_nickname": true, # bool/OPTIONAL: display information in nickname vs activity
"frequency": 10, # int/OPTIONAL: seconds between refresh
"discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx" # string: dicord bot token
}
Example:
curl -X POST -H "Content-Type: application/json" --data '{
"network": "polygon",
"frequency": 3,
"set_nickname": true,
"discord_bot_token": "xxxxxxx"
}' localhost:8080/gas
curl -X PATCH localhost:8080/gas/polygon
curl -X DELETE localhost:8080/gas/polygon
This bot lists the number of addresses that hold a particular token. You can choose from the ethereum or binance smart chain blockchains.
curl localhost:8080/holders
Payload:
{
"network": "ethereum", # string: one of: ethereum, binance-smart-chain, or polygon
"address": "0x00000000000000000000000000", # string: address of contract for token
"activity": "ethereum", # string: text to show in activity section of the bot
"set_nickname": true, # bool/OPTIONAL: display information in nickname vs activity
"frequency": 10, # int/OPTIONAL: seconds between refresh
"discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx" # string: dicord bot token
}
Example:
curl -X POST -H "Content-Type: application/json" --data '{
"network": "ethereum",
"address": "0x00000000000000",
"activity": "Holders of MyToken",
"set_nickname": true,
"frequency": 120,
"discord_bot_token": "xxxxxxx"
}' localhost:8080/holders
curl -X PATCH localhost:8080/holders/ethereum-0x00000000000000
curl -X DELETE localhost:8080/holders/ethereum-0x00000000000000
This bot gets the current rate for a given token. You can choose another token to pair with on price, or by default USDC is used. You can choose either the ethereum, binance smart chain, or polygon blockchain.
curl localhost:8080/token
Payload:
{
"network": "ethereum", # string: network of token, options are ethereum, binance-smart-chain, or polygon
"name": "my token", # string: display name of token
"contract": "0x00000", # string: contract address of token
"currency": "0x00000", # string/OPTIONAL: contract address of token to price against, default is USDC
"set_nickname": true, # bool/OPTIONAL: display information in nickname vs activity
"set_color": true, # bool/OPTIONAL: requires set_nickname
"decorator": "@", # string/OPTIONAL: what to show instead of arrows
"activity": "Hello;Its;Me", # string/OPTIONAL: list of strings to show in activity section
"source": "pancakeswap", # string/OPTIONAL: if the token is a BSC token, you can set pancakeswap here to use it vs 1inch; you can also set dexlab for solana tokens
"frequency": 10, # int/OPTIONAL: seconds between refresh
"discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx" # string: dicord bot token
}
Example:
curl -X POST -H "Content-Type: application/json" --data '{
"network": "polygon",
"contract": "0x0000000",
"frequency": 3,
"set_nickname": true,
"discord_bot_token": "xxxxxxx"
}' localhost:8080/token
curl -X PATCH localhost:8080/token/polygon-0x0000000
curl -X DELETE localhost:8080/token/polygon-0x0000000
Thanks to @jr0dd there is a helm chart for deploying to k8s clusters. His chart can be found here
You can also use a simple deployment file:
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
environment: public
name: ticker-cardano
spec:
replicas: 1
selector:
matchLabels:
environment: public
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
environment: public
spec:
containers:
- env:
- name: CRYPTO_NAME
value: cardano
- name: DISCORD_BOT_TOKEN
value: xxxxxxxxxxxxxxxxxxxxxx
- name: FREQUENCY
value: "1"
- name: SET_COLOR
value: "1"
- name: SET_NICKNAME
value: "1"
- name: TICKER
value: ADA
- name: TZ
value: America/Chicago
image: ghcr.io/rssnyder/discord-stock-ticker:1.8.1
name: ticker-cardano
resources: {}
restartPolicy: Always
status: {}
Since you have read this far, here is a picture of Louie at his favorite park: