简体   繁体   English

我想要在我的 discord.js 机器人中使用的特定命令

[英]Specific command I want in my discord.js bot

I'm looking for a specific command code for my discord.js bot, where you can send the command and get bitcoin's price in AUD and USD.我正在为我的 discord.js 机器人寻找特定的命令代码,您可以在其中发送命令并获取比特币的澳元和美元价格。 But, I can't find some code anywhere.但是,我无法在任何地方找到一些代码。 If someone can lend me some code, I will gladly use it and give credit.如果有人可以借给我一些代码,我会很乐意使用它并给予信任。 Thanks.谢谢。

You can use this API: https://api.alternative.me/v2/ticker/您可以使用此 API: https://api.alternative.me/v2/ticker/

Using fetch in NodeJS, you would do something like this:在 NodeJS 中使用 fetch,你会做这样的事情:

fetch("https://api.alternative.me/v2/ticker/").then(function (r) {
    r.json().then(function (data) {
        message.channel.send(data.data[1].quotes.USD.price)
    });
});

This API only features USD prices, for AUD you would need to find something else.此 API 仅提供美元价格,对于澳元,您需要找到其他东西。 I certainly hope this won't be used for another BTC scam bot.我当然希望这不会被用于另一个 BTC 诈骗机器人。

I'm looking for a specific command code for my discord.js bot, where you can send the command and get bitcoin's price in AUD and USD.我正在为我的 discord.js 机器人寻找特定的命令代码,您可以在其中发送命令并以澳元和美元计算比特币的价格。 But, I can't find some code anywhere.但是,我在任何地方都找不到一些代码。 If someone can lend me some code, I will gladly use it and give credit.如果有人可以借给我一些代码,我会很乐意使用它并给予信任。 Thanks.谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM