A Telegram Assistent Bot.
This is a personal telegram bot. Some plugins are added to the project to provide additional bot services.
Firts: git clone https://github.com/marcosnunesmbs/BitRick.git
Next: cd BitRick
-
Create a Telegram Bot and save the Token with @BotFather.
1.1. Open your Telegram and search for: @BotFather;
1.2. Type it: /newbot;
1.3. Set a name to your bot;
1.4. Set a username
1.5. You will receive a Token. Save it.
-
Copy the sample.config.json file to config.json in the /src/config folder.
-
Set your botToken and TelegramID (your user id in telegram).
3.1 To get your User Id, you need to search fot @userdatabot, type /start and receive your id.
-
To active plugins services you need to set a array of services names on modules key on /src/config/config.js file.
-
You can find the avaliable services in /src/plugins folders.
-
Serach your bot username on Telegram and start it.
-
Join It!
- index.js - main file
- config.js - the plugin configuration file
- responses.js - a array of bot responses to errors
- /services/plugin-name.js - the file that provider connection with api services.
The config.js is necessary to bot map all plugins that have and create the commands helpers.
The bot will just map the services that been set in main config.js modules key.
{
"module_name": "Binance",
"description": "Realize consultas na exchange Binance.",
"functions": [
{
"name": "consultar saldo",
"description": "digite bbalance + moeda para saber o salgo",
"keypass": "bbalance"
},
{
"name": "consultar cotação",
"description": "digite btrade + par para saber a cotação",
"keypass": "bprice"
},
{
"name": "consultar ordens",
"description": "digite bordens + par para saber as ordens finalizadas e em aberto",
"keypass": "borders"
}
],
"APIKEY": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"APISECRET": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
The module_name key will be used to bot create the command to show the funcitons commands.
To create a new pluign you can use the npm script new:plugin and add --flag to set name.
npm run new:plugin --name=myplugin
This plugin provides some Binance's Servies like: Consult Balances, Verify Criptocurrencys Prices and Your last orders.
You need to config your APIKEY and APISECRET in /src/plugins/binance/config.js
Main Command: /binance
This plugin offers a cryptocurrency conversion based on CoinMarketCap API.
You need to config your APIKEY in /src/plugins/cmc/config.js
Main Command: /coinmarketcap
If You like this bot, you can donate. Thanks.
NANO: nano_3mjxfnquraoygt4u6uxipeh9pznwbmzx7ncy1dk5ahe6qnf197x917d6ghom
Bitcoin: 3Mt3hGJGWpN2p5AmeAzGvK5Uu9pegSz5J5