Skip to content

pierregoutheraud/nyano-discord-bot

Repository files navigation

Nyano discord bot

Nyano introduction

Nyano is a new representation of nano, not a new coin.
1 nano = 1,000,000 nyano

Install

Use this link to install the bot on your Discord server: https://discord.com/api/oauth2/authorize?client_id=907983349954535465&permissions=0&scope=bot%20applications.commands

How does it work?

Type / in the discord server to see the commands.

All commands

/nyano-address Display your nyano address.
/nyano-balance Display your nyano balance.
/nyano-send {address} {amount} Send nyano to an address.
/nyano-send-max {address} Send all your nyano to an address.
/nyano-tip {username} {amount} Tip a discord user.

Development

Database

The idea is to have one seed for all discord users. This seed is not stored in database and only set in config.json file.
Each user gets a new index and thus one account of this wallet.
Firebase is used to store every users indexes and a global index which is incremented for every new user.


Run script

  1. Copy example.config.json into a new file named config.json by running cp example.config.json config.json and fill in you configuration variables.
{
  "DISCORD_CLIENT_ID": ""   // Discord client id (Required)
  "DISCORD_TOKEN": "",      // Discord bot token (Required)
  "NANO_SEED": "",          // The seed used to store every users addresses (Required)
  "NANO_NODE_URL": "",      // Nano node url for rpc api (Required)
  "DATABASE_URL": "",       // Your firebase database url (Required)
  "LOGTAIL_KEY": "",        // key from logtail.com (Optional)
}
  1. Create a firebase-credentials.json file at the root with your firebase-admin credentials.
  2. Run yarn dev.

Deploy discord commands

yarn deploy-commands