Giter VIP home page Giter VIP logo

Comments (12)

BuZZy1337 avatar BuZZy1337 commented on June 28, 2024

from iobroker.telegram.

ramizh avatar ramizh commented on June 28, 2024

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.

BuZZy1337 avatar BuZZy1337 commented on June 28, 2024

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.

BuZZy1337 avatar BuZZy1337 commented on June 28, 2024

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.

ramizh avatar ramizh commented on June 28, 2024

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.

ramizh avatar ramizh commented on June 28, 2024

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.

BuZZy1337 avatar BuZZy1337 commented on June 28, 2024

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.

BuZZy1337 avatar BuZZy1337 commented on June 28, 2024

P.s.: don't forget to close this issue here on github.. ;)

from iobroker.telegram.

ramizh avatar ramizh commented on June 28, 2024

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.

ramizh avatar ramizh commented on June 28, 2024

Issue moved to iobroker.javascript

from iobroker.telegram.

BuZZy1337 avatar BuZZy1337 commented on June 28, 2024

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.

BuZZy1337 avatar BuZZy1337 commented on June 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.