Comments (12)
from iobroker.telegram.
for example if I put in block the username 123456789 it will be like this in written code, but it wont send anything to anyone, most importantly nothing to the user specified.
sendTo("telegram.0", "send", { text: 'Test Message', user: '123456789' });
But if i change user with chatId then it will send the message to that specific user only
sendTo("telegram.0", "send", { text: 'Test Message', chatId: '123456789' });
from iobroker.telegram.
Username has to be the username. Not the ChatID!
Check the data point telegram.0.communicate.users there is a list of chatID and the linked username.
from iobroker.telegram.
Here for example is my datapoint telegram.0.communicate.users ..
{"40452xxxx":"BuZZy","41648xxxx":"otherUser"}
So my telegram username is BuZZy and my chatID is 40452xxxx.
Now i can use the Username BuZZy OR the chatID 40452xxxx to send messages to my phone..
You must not enter the chatID as User or the User as chatID..
If you enter the chatID as User or the User as chatID it will not work..
from iobroker.telegram.
okay before I used the whole thing with the ID and that is why it did not work. So in your case if you put BuZZy as username in blocky it will text you directly.
Is the username unique? Cause I have not chosen any and it basically used my first name to as username, so I am wondering if the user is not unique wouldn't it be more accurate to use the ID? Unless I missed a step where I set my first name as my username (doubt though)
Ill submit this again in iobroker.javascript if users are not unique.
Thanks for the help, much appreciated!
from iobroker.telegram.
Never mind, sometimes my brain is blocked completely. I just checked the app, I can set a username for myself now and it is unique, but if you never set one the adapter will use your first name as username!
My bad!
from iobroker.telegram.
Well.. The Telegram Adapter picked my firstname as Uername too.. But i changed it to "BuZZy" in the example that i posted above..
Not sure if it picks the "public username" that you can set in the telegram app on your phone..
I connected the bot to my telegram app before i entered a public username in the telegram app.. 😃
EDIT: Whoops, missed your last comment.. Glad that its working now.
You are very welcome! 👍
from iobroker.telegram.
P.s.: don't forget to close this issue here on github.. ;)
from iobroker.telegram.
I did not forget xD, I was testing he username thing and it does not work... Adapter assumes first name is the username. Even after I deleted everything and reinstalled and setup a bot again.
With chatId it is still far more reliable and reacts all the time, when using username (with my first name) to send a message to a specific person it sometimes for some reason does not send the message until a 2nd or 3rd trial.
So second problem is that the adapter takes first name as username instead of actual username.
from iobroker.telegram.
Issue moved to iobroker.javascript
from iobroker.telegram.
Uhhmm.. Yeah, but now the issue is clearly related to telegram... So you should close the issue on the Javascript repo and reopen this one here! Haha.. Sorry about that.
from iobroker.telegram.
Or better: open a new issue here in the telegram repo which describes the "new problem" that you have now.
from iobroker.telegram.
Related Issues (20)
- getMe (reconnect #1270) Error HOT 5
- Bild senden aus dem iobroker Storage
- sendTo gives strange return value HOT 6
- Update stable version in repo from 1.16.0 to 2.0.1 HOT 1
- Telegram causes npm error due to very outdated dependency
- sendig photo example uses outdated request package
- Install Telegram Adapter failed HOT 1
- Update stable version in repo from 2.0.1 to 3.0.0 HOT 1
- Bad Request: can't parse entities: Character '!' is reserved and must be escaped with the preceding '\' HOT 4
- Feld für Userid hinzufügen bei benutzerdefinierten Einstellungen
- [JsonConfig] Cannot read instance object: TypeError: Cannot read properties of undefined (reading 'enc') HOT 2
- Update stable version in repo from 3.0.0 to 3.0.1 HOT 1
- Send state updates with silent option
- Update stable version in repo from 3.0.1 to 3.1.0 HOT 1
- callback_data: Funktion aus InlineKeyboardMarkup auch im ReplyKeyboardMarkup HOT 1
- Error originated by #805 HOT 3
- Errors on deleteMessage thrown when user is not set HOT 1
- Update stable version in repo from 3.1.0 to 3.2.1 HOT 1
- Error 25 during newest update from 3.1.0 to 3.2.1 HOT 3
- Nachricht wird nicht in Thema gesendet / Message is not sent in topic / theme / subgruoup HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iobroker.telegram.