-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Token ID #124
Comments
If you would alter the token you would need to restart the bot... is that what you want? |
Hello. no, what I want is that a person who generates his own bot from telegram can configure the token of his own bot from the nodered dashboard. it's possible ?. Thanks for your reply |
No that is not possible, it would be only through a restart of node red. Maybe I will add this in future but it is not of the highest priority right now. |
Hi, I am also looking for a way to set the token in run-time. My use case is similar to @lexrosenot (I think) : the user doesn't have access to the Node-RED Telegram configuration node and will enter his/her token in another simplified user interface. |
No not really as the bot is started when deployed. Even if you could alter the value you would need to deploy the changes |
Thank you @windkh , this is my case : it's an embedded system and I have full control over all files and I can restart the Node-Red run-time. I could 1) modify/replace NR source files or 2) write the token to a config file and finally restart NR |
@jenskastensson |
It depends on when it would be available: If you think it could be available within a month - I can wait |
Let‘s start finding a nice solution by gathering some ideas... I would appreciate if anybody else would also provide his thoughts: Idea 1: instead of entering the token directly I could read it from an external config file. You would enter the full path to the file instead of the token in the config node Idea 2: I could read the token from an environment variable like reading from a file# Idea 3: this could also work somehow (https://flows.nodered.org/flow/6fe183c197b3464a1fe4d89744e068ff) but the bot would need to be triggered to reinitialize somehow. Idea 4: token in config is empty. The token is injected into the node via the msg object. Some predecessor in the flow would have to set this value at least in one initial message Idea 5: create a new config node which can be placed in the flow and controlled from e.g. an inject node. This one would be just a proxy to the real config node in the sidebar. Restarts could be done too, when the bot has a problems with the network. Idea 6: hack: enter a placeholder in the token field. Search an replace this placeholder in the config file of nodred before restarting the nodered instance. .... |
Any solution is fine for me, but is has to be possible to set it even if it's not empty. Personally, I think passing it on with the msg variable is the most commonly used method. But then I don't have the full picture. |
Idea 7 could be done in addition to others. |
@lexrosenot What do you think? |
BTW I will use it for a chatbot for Home Automation: PRATGLAD for Trådfri, https://pratglad.com |
Nice I did something similar... what speech to text engine did you use? ... ah just saw it. We used rasa ... also very nice |
We're using Snips, now SONOS
…On Sat, Sep 5, 2020 at 2:40 PM Karl-Heinz Wind ***@***.***> wrote:
Nice I did something similar... what speech to text engine did you use
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSPHQMNMUXRT4ZPZH6KHCLSEIWTXANCNFSM4QP76Y6A>
.
|
Hello guys, |
✔️ Idea 2 is implemented in version 8.6.0 |
Excellent, I'll have go tomorrow
…On Sun, Sep 6, 2020 at 2:20 PM Karl-Heinz Wind ***@***.***> wrote:
Idea 8 is implemented in version 8.6.0
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSPHQNBRAUVO5PGPA34LBLSEN47LANCNFSM4QP76Y6A>
.
|
Couldn't wait so tried it today.. It seems I have a problem: Node-RED v0.20.7 (the user base is on this version) |
Hm... I will check what happens when the variable is not set or not present |
I can't reproduce your problem. I am using the following environment: Can you try 8.6.1 of the nodes and recheck? |
Great, after upgrade to the latest version 8.6.1 it works as expected. Ill
try on a few more devices.
…On Sun, Sep 6, 2020 at 8:10 PM Karl-Heinz Wind ***@***.***> wrote:
Couldn't wait so tried it today.. It seems I have a problem: Node-RED
v0.20.7 (the user base is on this version)
I've updated node-red-contrib-telegrambot to 8.6.0 (shown in Palette)
Entered a token manually in the UI to confirm it works, then replaced the
token with {env.get("BOT_TOKEN")}
Edited the settings.js file and added
process.env.BOT_TOKEN = "61648djsjd....";
on the first line.
Restarted Node-RED (tried to reboot the system too) but I only see
"polling error" in the status field.
I verified that the env var is ok by adding a Inject node which reads
$BOT_TOKEN and send to debug output
The browser runs at very high CPU when the polling error happens, tis will
potentially be a problem for my usres too. Most of them will not use the
Telegram node, and so they will have the {env.get("BOT_TOKEN")} and and
empty env variable.
Do you have any ideas what goes wrong here and how I can troubleshoot it?
Thanks for your efforts
I can't reproduce your problem. I am using the following environment:
npm 6.4.1
node-red 1.1.2
node 10.15.0
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSPHQKEADTX2UZ43FR5AQTSEPGAFANCNFSM4QP76Y6A>
.
|
Just a quick note to let you know that I got it up and working, it's a bit
ugly but should work. I 'll get back when we've tested a bit more. Thx
…On Mon, Sep 7, 2020 at 8:21 AM Jens Kastensson ***@***.***> wrote:
Great, after upgrade to the latest version 8.6.1 it works as expected.
Ill try on a few more devices.
On Sun, Sep 6, 2020 at 8:10 PM Karl-Heinz Wind ***@***.***>
wrote:
> Couldn't wait so tried it today.. It seems I have a problem: Node-RED
> v0.20.7 (the user base is on this version)
> I've updated node-red-contrib-telegrambot to 8.6.0 (shown in Palette)
> Entered a token manually in the UI to confirm it works, then replaced the
> token with {env.get("BOT_TOKEN")}
> Edited the settings.js file and added
> process.env.BOT_TOKEN = "61648djsjd....";
> on the first line.
> Restarted Node-RED (tried to reboot the system too) but I only see
> "polling error" in the status field.
> I verified that the env var is ok by adding a Inject node which reads
> $BOT_TOKEN and send to debug output
> The browser runs at very high CPU when the polling error happens, tis
> will potentially be a problem for my usres too. Most of them will not use
> the Telegram node, and so they will have the {env.get("BOT_TOKEN")} and and
> empty env variable.
> Do you have any ideas what goes wrong here and how I can troubleshoot it?
> Thanks for your efforts
>
> I can't reproduce your problem. I am using the following environment:
> npm 6.4.1
> node-red 1.1.2
> node 10.15.0
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#124 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABSPHQKEADTX2UZ43FR5AQTSEPGAFANCNFSM4QP76Y6A>
> .
>
|
@jenskastensson should I close this issue or are you still interested in a better solution? |
Thanks, Karl, you can close it. It's not an ideal solution but you did it
very fast and it does the job! Highly appreciated, sorry for the delay I
've sent a small contribution
/Jens
…On Mon, Nov 30, 2020 at 10:23 PM Karl-Heinz Wind ***@***.***> wrote:
@jenskastensson <https://github.com/jenskastensson> should I close this
issue or are you still interested in a better solution?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSPHQPL5JWEHGOPPWU5RHDSSQEOZANCNFSM4QP76Y6A>
.
|
@jenskastensson I will create a better solution... just wanted to check the priorities |
Not urgent for me, I have the current solution implemented and tested!
Don't fix it if it ain't broke ;)
…On Tue, Dec 1, 2020 at 2:43 PM Karl-Heinz Wind ***@***.***> wrote:
@jenskastensson <https://github.com/jenskastensson> I will create a
better solution... just wanted to check the priorities
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSPHQPQXATBDMCABSGZTD3SSTXJBANCNFSM4QP76Y6A>
.
|
i can implement idea 2 very succesfully. thanks a lot ! |
I opened again … as I will try to improve this in future |
Senhores! |
muy bien |
Hello, is there any way to modify the token value in the node configuration at runtime from the node-red dashboard? The idea is that people without access to the node's configuration can do it from the dashboard. I really appreciate your work.
The text was updated successfully, but these errors were encountered: