uvmetal / neo-discord-bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NEO Discord Bot

Discord bot made for NEO community.

Description

This bot is specially made for the NEO (previously ANS) Discord server. Its purpose is to provide a multitude of functionality for new and seasoned members. Its primary function is to respond to certain text in channels by sending the user a message with information, such as "The current GAS price is $10, B$0.00001 and rank 5".

Modules

You can use the discord api methods listed here:

  • client is the client is Discord client
  • message is the message object

To write extra modules please take a look at the imports/commands folder.

const request = require('request');
const currency = require('currency-formatter');

// Export the module so it can be imported
module.exports = (client, message) => {
// Get the url and give back a json result
  request.get({
      url: 'https://api.coinmarketcap.com/v1/ticker/neo/?convert=USD',
      json: true
    },
    function (e, r, prices) {
      const price = prices[0];
      // Send a message to the channel
      message.channel.send(`The current NEO price is ${currency.format(price.price_usd, { code: 'USD' })}, B${price.price_btc} and rank ${price.rank}`);
    });
};

How to setup

  • Clone this repository
  • In the directory where it's located do npm install
  • Change the value in index.js [BOT_API_KEY], bot.js[MARKET_PRICE_CHANNEL] and report.js[REPORT_CHANNEL] to your own values
  • Run the bot with node index --apiKey "your_discord_api_key"

Roadmap

Release 0.1

  • Modular system
  • Initial modules
  • Text recognition
  • Remove command when said

Release 0.2

  • Respond privately
  • Add ignore feature

Release 0.3

  • More modules

About

License:MIT License


Languages

Language:JavaScript 100.0%