gaia-js-telegram-bot-api
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -37,3 +37,3 @@ module.exports = function(bot, mcp) { | ||
// Matches "/devices" | ||
// Matches "/device" | ||
bot.onText(/\/device/, function (msg, match) { | ||
@@ -60,2 +60,24 @@ var chatId = msg.chat.id; | ||
// Matches "/controller" | ||
bot.onText(/\/controller/, function (msg, match) { | ||
var chatId = msg.chat.id; | ||
if(!mcp.started) { | ||
bot.sendMessage(chatId, 'Sorry Gaia is stoped... \n /start it first for controller access'); | ||
return; | ||
} | ||
var message = ''; | ||
// Search in all controllers | ||
for (var i = 0; i < mcp.controllers.length; i++) { | ||
message += '-- ' + mcp.controllers[i].name + ' --' + '\n \n'; | ||
var attributes = mcp.controllers[i].getAttributes(); | ||
for (var key in attributes){ | ||
message += key + ': ' + attributes[key] + '\n'; | ||
} | ||
} | ||
bot.sendMessage(chatId, message); | ||
}); | ||
// Matches "/help" | ||
@@ -78,4 +100,7 @@ bot.onText(/\/help/, function (msg, match) { | ||
//Controller | ||
message += '/controller - Get a lis of the current controllers and attributes. \n'; | ||
bot.sendMessage(chatId, message); | ||
}); | ||
}; |
{ | ||
"name": "gaia-js-telegram-bot-api", | ||
"description": "Node-telegram-bot-api interface for gaia-js", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6529
122