Closed giga89 closed 2 years ago
localhost:8080/crypto
is not correct, there is no crypto
endpoint.
See the docs for the bot types:
use /ticker
The service is on because when I stop it with "systemctl stop discord-stock-ticker.service" I have "Failed to connect to localhost port 8080: Connection refused" error.
well yeah, if you stop the service, its not running anymore, so you cant connect.
You save me. Bad day today sorry..
But now I have another error (or maybe I'm doing another mistake :))
No error on this command -> curl -X POST -H "Content-type: application/json" -d @test.json localhost:8080/ticker
But ticker list is empy curl -X POST -H "Content-type: application/json" -d @test.json localhost:8080/ticker {}
Why? Thank u in advance
No error on this command -> curl -X POST -H "Content-type: application/json" -d @test.json localhost:8080/ticker
if this call is successful it will return a JSON of the bot. does it return anything? are you watching the logs for the service? the logs should tell you everything you need to know.
Ok I'll try to check the log :) Where I can found it?
Ok I'll try to check the log :) Where I can found it?
journalctl -f -u discord-stock-ticker.service
No journal files were found. :(
you never answered by first question:
if this call is successful it will return a JSON of the bot. does it return anything?
It return anything :/
It return anything :/
ok then your JSON isnt correct. post it here and i will take a look.
You are very kind.. thank u so much
This is my json
{ "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 "color": true, # bool/OPTIONAL: requires nickname "decorator": "@", # string/OPTIONAL: what to show instead of arrows "currency": "aud", # string/OPTIONAL: alternative curreny "currency_symbol": "AUD", # string/OPTIONAL: alternative curreny symbol "pair": "binancecoin", # string/OPTIONAL: pair the coin with another coin, replaces> "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 secti> "decimals": 3, # int/OPTIONAL: set number of decimal places "nickname": true, # bool/OPTIONAL: display information in nickname vs activity "frequency": 10, # int/OPTIONAL: seconds between refresh "discord_bot_token": "" # string: dicord bot token }
{
"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
"color": true, # bool/OPTIONAL: requires nickname
"decorator": "@", # string/OPTIONAL: what to show instead of arrows
"currency": "aud", # string/OPTIONAL: alternative curreny
"currency_symbol": "AUD", # string/OPTIONAL: alternative curreny symbol
"pair": "binancecoin", # string/OPTIONAL: pair the coin with another coin, replaces>
"pair_flip": true, # bool/OPTIONAL: show
edit: bot token is just a try that I'll change with another bot, no secret to hide
JSON cannot have comments, you need to remove all the comments.
HOLY SHIT. I have to remove comments.
You also just shared your bot token, please rotate it now.
Thank you @rssnyder . you are an angel in a bad day. now it's work
Hi, I follow "Self-Hosting - Binary" procedure but I have a problem to create a new bot. When I call my curl "curl -X POST -H "Content-type: application/json" -d @test.json localhost:8080/crypto" I have 404 page not found.
The service is on because when I stop it with "systemctl stop discord-stock-ticker.service" I have "Failed to connect to localhost port 8080: Connection refused" error.
What is my error? :) Thanks