Open telegram bot chat without start command - bots

How can a telegram bot open self bot chat without start command, in answerCallbackQuery method, responding to inline buttons?
This opens bot's chat, but appends "/start" into chat
https://t.me/<bot-name>?start=<start-parameter>
This one opens bot's chat without appending "/start". But seems to me more of a bug than a correct way.
https://t.me/<bot-name>?start=a:b
This other ones report URL_INVALID:
https://t.me/<bot-name>?start=
https://t.me/<bot-name>?start
https://t.me/<bot-name>?
https://t.me/<bot-name>
https://t.me/<bot-name>/

It is not possible to redirect to the bot's chat with a command rather than /start. The only 2 parameters that are accepted in the bot URL are:
start which is for starting the bot in private chat, and
startgroup which lets the user choose a group to start the bot in.
And there's something to be aware of: Their values will be appended after a space after the /start. For example if your URL is t.me/yourbot?start=a, your bot will get a message with the text /start a.

Related

ms teams custom app starting a chat session with a bot

I'm building a teams app that contains some tabs and a bot.
Is it possible to, when an action is performed on a tab (i.e. clicking a button), initialize automatically a chat with the bot, or send a specific message?
Tks
Based on the comments above, what you're looking to do is implement "pro-active" messaging, where the bot itself initiates the conversation. It's definitely possible, and you can read more to get started here and here. The most important thing to know is that your user has to have installed the bot already, to get a "conversation context", but if they've installed the app, which includes the bot, to get the tab, then you're fine. You need to get some variables when they do install the app, which you hook into the conversationUpdate event to get access to. Give it a go and let me know if you have specific questions, here on SOverflow.

How to send a document through a Telegram bot to user without a command?

I want to send a document through a bot to a user without the user having to enter a command. I'm using the pyTelegramAPI library.
I want the bot to send a document to a user on a certain day and time automatically, without the user having to type any command. I will use the Windows task scheduler.
I found a solution at https://medium.com/#ManHay_Hong/how-to-create-a-telegram-bot-and-send-messages-with-python-4cf314d9fa3e
On Telegram, search your bot (by the username you just created), press the Start button or send a /start message.
Open a new tab with your browser, enter https://api.telegram.org/bot<yourtoken>/getUpdates , replace <yourtoken> with your API token, press enter and you should see something like this:
{"ok":true,"result":[{"update_id":77xxxxxxx,
"message":{"message_id":550,"from":{"id":34xxxxxxx,"is_bot":false,"first_name":"Man Hay","last_name":"Hong","username":"manhay212","language_code":"en-HK"}
Look for id, for instance, 34xxxxxxx above is the chat id. Look for yours and put it as your bot_chatID in the code.

Send private message to a slackbot without other users of the workspace seeing it

How can i send a private message to a bot other without users seeing it on the channel?
Im using node js and the module slackbots. And each time i communicate with the bot it goes something like this: "#robot hello" but everybody on the chat sees it.
Your example is not a direct message, but a so called "mention" in a channel, which is always visible by everyone else in the same channel.
But you can also send a real direct message to a bot user. It works the same like sending a direct message to any user. e.g. click on the plus next to "Direct Messages", select the bot user from the list and click on go. Now you got a direct messaging channel with that user which is 100% private.
Your bot obviously needs to be ready to receive messages via DM in order to respond correctly. e.g if your are using Slack's Events API you need to subscribe to message.im to receive posts in the direct message channel to your bot.
Check out this help desk page on how to send direct messages.
Another approach to communicate "secretly" with your bot user in a channel is slash commands, e.g. by posting /mybot hi in a channel. Both the slash command and respond from your app will not be visible to anyone else in the channel (that is default - but can be changed).

sending direct messages from nodejs script to telegram

Is it possible to send a message from a node.js server to someone's mobile number or telegram Id directly?
is it possible without using a telegram bot?
I need an API like below:
function sendMessage(senderTelegramId, receiverTelegramId, messageText)
In short: No, without a bot no way for now.
Detailed explanation:
In order for you to send users messages on telegram you would need to create your own telegram bot. They have a well documented API which you can read and play around with.
There are 2 things you should know about sending messages to users using telegram bot:
You can't just send random people messages on telegram even if you know their phone number, to send them messages you need to have their chat_id. See how in the docs
To get the chat_id the user must first click the start button that comes up when they open your bot for the first time. Telegram will send you the chat id of that user and you save it for later when you would want to send messages to that user.
There are tons of libraries that makes working telegram bots very easy, it wouldn't take you more than an hour to get started.
I hope this answers the question, feel free to ask further questions, I have made some bots and you can also play around with them to see how it works.
Cheers )
There is actually one more easiest way to send a message to chat
just fetch the URL
https://api.telegram.org/bot[BOT_API_KEY]/sendMessage?chat_id=[MY_CHANNEL_NAME]&text=[MY_MESSAGE_TEXT]
you can find more details here
https://xabaras.medium.com/sending-a-message-to-a-telegram-channel-the-easy-way-eb0a0b32968

Facebook Messenger :How to show a greeting message when start conversation

I want to show a greeting message when start a conversation on Facebook Messenger ( before any user input ) . How to do it?
The problem is : My code is for server by NodeJS ,and it only trigger when a message is send to server ,which mean it only be triggered when users send something.
Facebook messenger doesn't send anything when you press button "Message".
I have check this link Messenger Greeting , but it only shows when a new user starts chat ,but i need show it when starting conversations
You have to set a welcome message, using the Facebook Api.
Find the documentation here: https://developers.facebook.com/docs/messenger-platform/implementation#welcome_screen
As explained in the documentation, you have to make a POST request to https://graph.facebook.com/v2.6/<PAGE_ID>/thread_settings?access_token=<PAGE_ACCESS_TOKEN>
You need to make the POST request only once, then Facebook will automatically prompt your welcome message whenever a user starts a chat.
I wrote and answer for this question here.
Have a nice working ;)

Resources