简介
hubot-cryptoprice 是一个用于机器人聊天程序的 npm 包。它可以帮助用户在聊天程序中查询各种加密货币的价格和统计信息。例如你可以使用 !bitcoin
命令查询比特币的价格。
该 npm 包可以轻松集成到 hubot 中,从而在 slack、slackbot、HipChat 等平台上使用。
安装
在安装之前,你需要在系统中安装 Node.js 和 npm。
在命令行中运行以下命令:
npm install --save hubot-cryptoprice
配置
在你的 hubot 项目的 external-scripts.json
文件中添加 "hubot-cryptoprice":
[ "hubot-cryptoprice" ]
更新 hubot 的依赖:
npm install
使用
以下是 hubot-cryptoprice 的命令和示例:
查询比特币价格:
user> !bitcoin hubot> Bitcoin is currently at USD 37323.08000000
查询以太坊价格:
user> !ethereum hubot> Ethereum is currently at USD 2231.46000000
查询莱特币价格:
user> !litecoin hubot> Litecoin is currently at USD 132.25000000
查询狗狗币价格:
user> !dogecoin hubot> Dogecoin is currently at USD 0.23416700
查询所有加密货币的价格:
user> !cryptolist hubot> Bitcoin is currently at USD 37323.08000000 Ethereum is currently at USD 2231.46000000 Litecoin is currently at USD 132.25000000 Dogecoin is currently at USD 0.23416700
查询比特币的市场份额:
user> !btcmarketcap hubot> Bitcoin's market cap is at USD 699,574,456,509
查询所有加密货币的市场份额:
user> !cryptomarketcap hubot> Bitcoin's market cap is at USD 699,574,456,509 Ethereum's market cap is at USD 265,978,166,269 Tether's market cap is at USD 62,605,086,092 Binance Coin's market cap is at USD 52,109,596,280 Cardano's market cap is at USD 42,335,411,514 ...
查询比特币的交易量:
user> !btcvolume hubot> Bitcoin trading volume in the last 24 hours is at USD 48,657,177,545
查询所有加密货币的交易量:
user> !cryptovolume hubot> Bitcoin trading volume in the last 24 hours is at USD 48,657,177,545 Ethereum trading volume in the last 24 hours is at USD 20,271,903,618 Binance Coin trading volume in the last 24 hours is at USD 3,783,256,683 Tether trading volume in the last 24 hours is at USD 57,493,819,525 Cardano trading volume in the last 24 hours is at USD 1,743,520,766 ...
结语
hubot-cryptoprice 是一个十分简单实用的 npm 包,方便用户查询加密货币的价格、市场份额和交易量。希望这篇教程对你有用。
来源:JavaScript中文网 ,转载请注明来源 https://www.javascriptcn.com/post/6005678881e8991b448e3e98