Send message to phone number not #username using Telegram Bot - api

Is this possible to send message to phone number not #username using telegram bot?
If answer is No, I have to say I have telegram account without #username and several days ago I got message from a Bot, how this is possible?
Any advice will be helpful.

its not possible send message to phone number or username. you can only send message by ID.
i almost try every thing.(group chat or channel) the only way, bot can send a message to the user is the user start the conversation.

i can send message in to telegram channel with:
https://api.telegram.org/bot"your token"/sendMessage?chat_id="your chat public link as #msg"&text=123
wold replaced "your token" with token
and replaced "your chat public link as #msg" with chanel name
important:
your bot must be as administrator of your chanel

Related

How to send message to the user by using telegram id and python_telegram_bot library?

I want to send the message to anybody by using his telegramid and python_telegram_bot library.
I can send the message to me by using below code but if I put other's id then I can not send the message and it says chat not found message.
updater = Updater(mybot_token, use_context=True)
updater.bot.send_message(chat_id = receiver_id, text="welcome")
I am not sure why it is only possible to send the message to me, not the others even though I puth the chat_id as their telegram_id.
Bots can only send messages to users that have already started the bot. See the Telegram Bot docs.

How to get authenticated by Telegram bot in Group chats?

Please kindly someone explain me how can the Telegram bot could understand who is sending the command in group chats and respond it with the the unique answer which is just for that user.
Surely in this case security issues should be considered and a user must not send command as another user.
I guess I can use username to send along with command.
Any suggestions...
The Message Object contains two objects apart from other objects:
Chat, message['chat'] which represents the Chat from which the message is coming. In your case the group.
User, message['from'] which represents the user that sent the message/command.
So it's easy to differentiate which user sent the message. And in case of Private chats, both the Chat object and the User Object are same.

can Telegram Bot sends message to group?

I create a group on Telegram and created a bot and add in.
I am trying to send a message to group that I created and the error shown as below
{"ok":false,"error_code":403,"description":"[Error]: Forbidden: can't write to chat with deleted user"}
I have use getUpdates from Bot Documents and managed to get chat id and doesn't work again for me. p2p (private type message) works for me but not group type.
Any advice please? Thank you.
Yes you can, you have to invite the bot into the group, grab the chat_id of the group and send the message as you are sending a normal message to a private user.
The error message is self-explanatory tough.

Telegram : How can show welcome message for new join bot

I create new bot in telegram bot ,and do steps like here :-
https://core.telegram.org/bots#
But now i need when any new user join in my bot, i need to show him welcome message.
How can do that ?
Use /setdescription and /setabouttext #BotFather commands
You must send these commands to #BotFather
/setdescription
then send your bot id like:
#example_bot
and send you welcome message
Welcome to my bot
You need to implement the /start command in your bot realization - set the welcome message.
And you should describe this command in chat with #BotFather via /setcommands for your bot.
After that when user adds your bot, the /start command fires automatically, and he will see the message you implemented.

How can I send message to specific chatID?

I have chatId and want send messages while execute some tasks from java code. I found this explain on telegram "Bots can't initiate conversations with users. A user must either add them to a group or send them a message first. People can use telegram.me/ links or username search to find your bot." But my task works good when I use https request directly from browser. My bot perfectly answer for requests but how I can do this without user request?
I can not truly understand your case!
Anyway, your bot can send a message to a chat ID Only if the user witch blongs to the specified chat ID added your bot (send start to a bot).
and if it happened then send your message with
/sendMessage