Naltox / telegram-node-bot

Node module for creating Telegram bots.
MIT License
720 stars 144 forks source link

.sendMessage chat_id issue #181

Closed eouia closed 6 years ago

eouia commented 6 years ago

I cannot find anything about this.

tg.onMaster(() => {
  tg.api.sendMessage('@someone', "I'm alive!")
    .then(function(d) {console.log(d)})
    .catch(function(e){console.log(e)})
  })

This code makes error

TelegramApiError { _code: 400, _description: 'Bad Request: chat not found' }

But when I use chat_id as numbers, it works. @username or username is not supported? This bot is already /start-ed by username. I want my bot to send messages to this user sometimes. How can I do that?

eouia commented 6 years ago

Closing the issue. Thanks for everyone. I misunderstood mechanism of telegram API.