{"id":38986923,"url":"https://github.com/soyart/fngobot","last_synced_at":"2026-01-17T17:00:00.262Z","repository":{"id":44964021,"uuid":"369862362","full_name":"soyart/fngobot","owner":"soyart","description":"a simple, stupid Telegram chatbot for tracking financial markets","archived":false,"fork":false,"pushed_at":"2022-09-05T21:17:47.000Z","size":931,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T13:30:06.952Z","etag":null,"topics":["binance","bitkub","coinbase","cryptocurrency","finance","satang","stock-market","telegram","telegram-bot"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soyart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-22T16:59:50.000Z","updated_at":"2024-04-07T05:05:05.000Z","dependencies_parsed_at":"2023-01-17T21:47:44.573Z","dependency_job_id":null,"html_url":"https://github.com/soyart/fngobot","commit_stats":null,"previous_names":["soyart/fngobot","artnoi43/fngobot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/soyart/fngobot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soyart%2Ffngobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soyart%2Ffngobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soyart%2Ffngobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soyart%2Ffngobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soyart","download_url":"https://codeload.github.com/soyart/fngobot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soyart%2Ffngobot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binance","bitkub","coinbase","cryptocurrency","finance","satang","stock-market","telegram","telegram-bot"],"created_at":"2026-01-17T17:00:00.032Z","updated_at":"2026-01-17T17:00:00.224Z","avatar_url":"https://github.com/soyart.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FnGoBot\nA simple, stupid CLI/Telegram bot for tracking financial markets. FnGoBot can be run as a standalone CLI program, or as a Telegram chatbot. Both versions share the same text interface (see `bot` package).\n\nFnGoBot is my practice project for designing more complicated software, parsing JSON responses, and using external libraries. It developed from an ugly single-file program into a much more *normal* looking Go project.\n\nThe Telegram part is made possible with [this amazing Go Telegram bot library](https://gopkg.in/tucnak/telebot.v3). It fetches quotes from Yahoo! Finance (via [finance-go](https://github.com/piquette/finance-go)), [Binance](https://binance.com), [Coinbase](https://coinbase.com), [Satang](https://satangcorp.com), and [Bitkub](https://bitkub.com).\n\n- This bot is currently in use in my friends' circle doing real trades, so the command-line patterns are not to be changed.\n\n# Quote sources\n## `github.com/piquette/finance-go`\nFor Yahoo! Finance API. This is the default security quote source.\n\n## `github.com/piquette/finance-go/crypto`\nFor Yahoo! Finance cryptocurrency API. This source is activated with a `crypto` switch in the command.\n\n## `fetch/binance/binance.go`\nFnGoBot's [Binance](https://binance.com) API data fetcher. This source is activated with a `binance` switch in the command.\n\n## `fetch/coinbase/coinbase.go`\nFnGoBot's [Coinbase](https://coinbase.com) API data fetcher. This source is activated with a `coinbase` switch in the command. Coinbase quotes are currently THB denominated, although this may change in the future, perhaps with adding currency configuration.\n\n## `fetch/satang/satang.go`\nFnGoBot's [satangcorp.com](https://satangcorp.com) API data fetcher. This source is activated with a `satang` switch in the command. Satang quotes are only THB denominated\n\n## `fetch/bitkub/bitkub.go`\nFnGoBot's [bitkub.com](https://bitkub.com) API data fetcher. This source is activated with a `bitkub` switch in the command. Bitkub quotes are only THB denominated.\n\n## [Adding quote sources](add_source.md)\n\n## Running your own bot\n- Clone this repository\n\n- Provide your bot's [configuration](#config)\n\n- Run the bot with `go run ./cmd/fngobot` or `go run ./cmd/fngobot-cli`, or build and run the binaries\n\n- If the bot successfully initializes, you may now start using the bot\n\n- Start chatting with the bot. Send `/help` to get command-line help\n\n## \u003ca name=\"config\"\u003eConfiguration\u003c/a\u003e\nFnGoBot uses [Viper](github.com/spf13/viper) to manage configuration. The default config file is `$HOME/.config/fngobot/config.yml`, but `-c \u003cconfig file path\u003e` command-line option can also be used to load different configuration.\n### Configuration file type\nDefault configuration type is YAML, but other file types like JSON can also be used.\n\n\u003e Only YAML and JSON are tested for FnGobot, and TOML is not supported because Telegram bot token strings contain special character `:`.\n\nTo use other configuration types (must be supported by Viper), specify the configuation file with `-c \u003cconfig file\u003e`:\n\n    $ go run ./cmd -c path/to/config.json;\n\nOr change the default filename in `cmd/main.go` to your desired file extension.\n\n## Core external dependencies\n\n- `gopkg.in/tucnak/telebot.v3` Telegram bot framework\n\n- `github.com/piquette/finance-go` Yahoo! Finance data library\n\n- `github.com/google/uuid` Google UUID library\n\n- `github.com/spf13/viper` Configuration library\n\n- `golang.org/x/text/message` and `golang.org/x/text/language` for thousands operator (`,`)\n\n## Example commands\nThe chat will look like a CLI program. The bot supports 3 commands: `/quote`, `track`, and `/alert`. Source switches can be used in all commands to set quote source.\n\nThe general syntax for `/quote` is\n\n    /quote [source switch] \u003cticker\u003e [ticker..]\n\nThe example below will quote BBL.BK, KBANK.BK, KKP.BK from Yahoo! Finance:\n\n    /quote bbl.bk kbank.bk kkp.bk\n\nThe general syntax for `/track` is\n\n    /track [source switch] \u003cticker\u003e [ticker..] \u003crounds\u003e\n\nThe example below will track BTC-USD crypto pair for 2 times, each one minute apart:\n\n    /track crypto btc-usd 2\n\n`/alert` can handle one more switch - a bid/ask switch. This is because `/alert` can be used against last price and best bid/ask prices. If a bid/ask switch is used, it will alert based on bid or ask prices, if the bid/ask switch is not present, it will alert based on last price.\n\nThe general syntax for `/alert` is\n\n    /alert [source switch] \u003cticker\u003e [bid/ask switch] \u003cgreater/smaller\u003e \u003ctarget price\u003e\n\nThe two modes of `/alert` are not supported all quote sources - for example, Yahoo! Finance (crypto) does not support alert with bid/ask, while Satang source does not support alert with last price.\n\nThe example below will make the bot alert if BBL.BK 'last' price is greater than 120:\n\n    /alert bbl.bk \u003e 120\n\nThe example below will make the bot alert if BBL.BK 'ask' price is smaller than 115:\n\n    /alert bbl.bk ask \u003c 115\n\nThe example below will make the bot alert if BTC-USD (from Yahoo! Finance crypto) is greater than 30,000:\n\n    /alert crypto btc-usd \u003e 30000\n\nThe example below will make the bot alert if BTC (From Binance) last price is smaller than 30,000:\n\n    /alert binance btc \u003c 30000\n\nThe example below will make the bot alert if BTC (From Coinbase) bid price is smaller than 30,000:\n\n    /alert coinbase btc-usd bid \u003c 30000\n\nThe example below will make the bot alert if BTC (From Bitkub.com) bid price is smaller than 30,000:\n\n    /alert bitkub btc-usd bid \u003c 30000\n\n## Other chat commands\n\n`/handlers` is used to get all running handlers in JSON format.\n\n    /handlers\n\n`/stop` is used to stop a running handler. Let's say we have an alerting handler whose UUID is cfd337b7, to stop it, send:\n\n    /stop cfd337b7\n\n## Important packages\nAfter editing the code, you probably want to run tests on these packages before you start using FnGoBot.\n\nThe `parse` package provides command parsing for both CLI and Telegram versions. This means that they both share the same text interface.\n\nThe `bot` package defines logic for handling alerts, price tracking, and quoting, and is also used by both CLI and Telegram versions.\n\nThe `fetch` package, which fetches data from remote APIs, provides an interface (`fetch.Quoter`) to all quotes processed by FnGoBot.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoyart%2Ffngobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoyart%2Ffngobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoyart%2Ffngobot/lists"}