commit d242ef19d20eddc985e312462317c01f8ac9d0a1
parent 3c8f0eadfb81afad1d14c9acad1e579efac77d48
Author: Marcel <MTRNord@users.noreply.github.com>
Date: Fri, 2 Jun 2017 15:03:44 +0200
Update telegram.js
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/handlers/telegram.js b/handlers/telegram.js
@@ -26,8 +26,7 @@ module.exports = {
jsonfile.readFile('handlers/tmp/communities.json', 'utf8', function (err,obj) {
if (err) {throw new Error(err);}
var communities = obj
- _.find(communities, function (key) {
- var ccode = key;
+ _.forEach(communities, function (key, ccode) {
if (ccode.toLowerCase() === resp.toLowerCase()) {
getNodes.countNodes(resp.toLowerCase(), "telegram", fromId, msg, "", bot, botan)
}
@@ -45,8 +44,7 @@ module.exports = {
jsonfile.readFile('handlers/tmp/communities.json', 'utf8', function (err,obj) {
if (err) {throw new Error(err);}
var communities = obj
- _.find(communities, function (key) {
- var ccode = key;
+ _.forEach(communities, function (key, ccode) {
if (ccode.toLowerCase() === args[0].toLowerCase()) {
getNodes.NodeInfo(args[0].toLowerCase(), args[1].toLowerCase(), "telegram", fromId, msg, "", bot, botan)
}
@@ -63,8 +61,7 @@ module.exports = {
jsonfile.readFile('handlers/tmp/communities.json', 'utf8', function (err,obj) {
var communities = obj
var communities_list = ""
- _.find(communities, function (key) {
- var ccode = key
+ _.forEach(communities, function (key, ccode) {
var name = key["name"]
communities_list = communities_list + name + ": " + ccode + "\n"
});