# Global Configuration of Chatbot

**URL:** <https://discourse.nodered.org/t/global-configuration-of-chatbot/4153>\
**Category:** General\
**Created:** [20 October 2018 22:17 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153 "2018-10-20T22:17:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![DJCheeky](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@DJCheeky](https://discourse.nodered.org/u/DJCheeky)\
**Post date:** [20 October 2018 22:17 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/1 "2018-10-20T22:17:18Z")

</div>

Hi,  
I have tried this [Example](https://github.com/guidone/node-red-contrib-chatbot/wiki/Global-Configuration) for a Global Configuration.

```auto
`functionGlobalContext: { 
//Preformatted text
// os:require('os'), 
// jfive:require("johnny-five"), 
// j5board:require("johnny-five").Board({repl:false})
 telegram: { 'MyBot': {
 token: '1234567:my-token', 
 polling: 1000,
 parseMode: 'none',
 authorizedUsernames: 444
 } 
} 
},`

```

And this is Now my functionGlobalConfiguration. What am I doing wrong so that the Username does not appear in the Configuration of the Bot in the Chatbot

Thnaks a lot!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 October 2018 08:56 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/2 "2018-10-21T08:56:34Z")

</div>

The forum has messed up the formatting of your paste. Edit the post and insert a line containing three backtick characters before the paste and another such line after it.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [21 October 2018 09:02 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/3 "2018-10-21T09:02:58Z")

</div>

With a quick look, it looks like you are missing a slash at the beginning  
functionGlobalContext: { `/`Preformatted text  
should probably be:  
'functionGlobalContext: {`//`Preformatted text'

and you have a comma at the end of the last option:  
authorizedUsernames: 444`,` } } },  
should probably be:  
authorizedUsernames: 444 } } },

what kind of error are you getting?  
Waht bot are you trying to connect to?

---

<div class="post-metadata">

**Author:** ![DJCheeky](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@DJCheeky](https://discourse.nodered.org/u/DJCheeky)\
**Post date:** [21 October 2018 09:55 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/4 "2018-10-21T09:55:30Z")

</div>

As a Error at the start I get:

```
node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. module.js:653:30

```

And what do you mean with the kind of Bot?

---

<div class="post-metadata">

**Author:** ![DJCheeky](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@DJCheeky](https://discourse.nodered.org/u/DJCheeky)\
**Post date:** [21 October 2018 10:26 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/5 "2018-10-21T10:26:49Z")

</div>

Ok it works but is there a way to inject something there from the flow?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [21 October 2018 10:47 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/6 "2018-10-21T10:47:22Z")

</div>

When you say '...is there a way to inject something there from the flow?' do you mean you want to send a message to telegram?  
If so, have you looked at the nodes that you now have once you installed node-red-contrib-chatbot?

---

<div class="post-metadata">

**Author:** ![DJCheeky](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@DJCheeky](https://discourse.nodered.org/u/DJCheeky)\
**Post date:** [21 October 2018 11:36 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/7 "2018-10-21T11:36:44Z")

</div>

No not that I have a text input wich adds UserIds to a Array and I want that array in the configuration so that I can Add UserIds to the Telegram Bot

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 October 2018 12:52 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/8 "2018-10-21T12:52:37Z")

</div>

Unless you need something that only chatbot provides, personally I recommend using the other Telegram node, it is a lot easier to comprehend and work with. I've always had issues with Chatbot.

---

<div class="post-metadata">

**Author:** ![DJCheeky](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@DJCheeky](https://discourse.nodered.org/u/DJCheeky)\
**Post date:** [21 October 2018 13:38 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/9 "2018-10-21T13:38:03Z")

</div>

But have you an Example how this will work for the other node?

---

<div class="post-metadata">

**Author:** ![DJCheeky](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@DJCheeky](https://discourse.nodered.org/u/DJCheeky)\
**Post date:** [21 October 2018 13:38 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/10 "2018-10-21T13:38:58Z")

</div>

Or could I read files in the settings.js?  
And if yes which kind of files?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 October 2018 15:02 UTC](https://discourse.nodered.org/t/global-configuration-of-chatbot/4153/11 "2018-10-21T15:02:48Z")

</div>

> [@DJCheeky](#):
>
> But have you an Example how this will work for the other node?

I have a fairly extensive example I think on the flows site so just search there for telegram.

This is the node you want:

> **[node-red-contrib-telegrambot](https://flows.nodered.org/node/node-red-contrib-telegrambot)**
>
> Telegram bot nodes for Node-RED

And this is my example:

[https://flows.nodered.org/flow/c092bc6bcd4131a59cab52e82afbc7be](https://flows.nodered.org/flow/c092bc6bcd4131a59cab52e82afbc7be)
