How to add/link Facebook Messenger Maps to the bot button? - facebook-messenger-bot

Struggling to add/link Facebook Messenger maps to the bot button. Want to get user's location, users can pinpoint and search the location. Pictures are attached to clarify what I am struggling with and trying to achieve.
[1]: https://i.stack.imgur.com/LrF7c.jpg [Button "Send Location"][1]
[2]: https://i.stack.imgur.com/DahRC.jpg [When user clicks on the button "Send Location", it should brings up the maps(facebook-messenger-maps), where user can pinpoint or search the location][2]

These are the quick Replies in messenger platform.
QuickReply quickreply = new QuickReply("Title","payload");
Message message = new Message("any string");
message.addQuickReply();
message.setMetadata("metadata payload"); // optional metadata
SendMessage(recipient,message)
This is the syntax of declaring and sending quick reply to messenger.
Happy Coding:-)

Related

How can I open a specific telegram account with preloaded text message

Is it possible to open a specific account with a preloaded text like this:
tg://resolve?domain={USER_NAME}&text=Hi, default message
https://t.me/{USER_NAME}?text=Hi, default message
There isn't (yet) a option to open a chat for a specific user, however, you can open the Telegram app, with an preloaded text, the user get's the option to pick a recipient from there chat list;
Use the following url;
tg://msg_url?url=Hi%21%20I%27m%20an%20example%21
Where;
url is the preloaded message (or link) (url-encoded)
After pressing the link, Telegram will ask for a recipent (picture).
If the user selects a chat from the sidebar, the preloaded text will be filled in the chat box (picture)

Telegram bot deep linking and scrolling to certain message

I've created a telegram bot and have many messages in the chat, I want to programmatically scroll to a certain message inside the chat, for example I want to have a link deep linked to a message in the chat so when I click on the link I would see the message in the chat but for some reason it's not working. Lookhing through the documentation this should do the trick
t.me/c/chat_id/message_id
Or
tg://openmessage?user_id=xxxchat_id=xxx&message_id=xxx
Unfortunately none of these work for me, does any one know what I'm doing wrong?
The t.me/c format can only be used to link to a channel post, try the following steps to 'create a link';
Create new Channel
'Post' a message
Right click on the message -> 'Copy Post Link'
This will give you the following link: https://t.me/<channel_name>/<message_id>
This 'linking' does not work for private chats/groups. The only way I've managed to link to such a sort message is by sending a requglar sendMessage() with a reply_to_message_id_ so you can press that message, and telegram will show the 'quoted' message!

How to refer to a user in chat with their UIDs?

I have an array of User IDs which I've set as admins and I would like to print them to clients when they call the /admins command.
The main issue is that I couldn't see or find a way to print a placeholder entity (it's mention in this case) which opens a chat window with the IDs I've specified.
Remember that when you post #username in a chat, Telegram simply binds it as a mention to the referenced user and it jumps on a chat window when you click on it. I wonder if there is an equivalent for #123456789, where the number represents the User ID.
if you create/send a message from a bot, you can set parse_mode to HTML, then send text/caption with HTML anchor tag same this:
for contact me, just click here
but if you want to send message as user, you can just use userName prefixed by #, and creating manual link to tg://user?id=123 or type plain text like tg://user?id=123, don't work in Telegram now. yes; just in iOS (less than 15% of Telegram user) that work since 2013!

Google Calendar API: Event source.title and source.url : new calendar interface shows "This event was automatically created from an email."

When creating an event with the API:
https://developers.google.com/google-apps/calendar/v3/reference/events/insert
If I fill the fields source.title and source.url:
source.title string Title of the source; for example a title of a web page or an email subject.
source.url string URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS.
With the old interface, on the event I could see a read-only field, between "Calendar" and "Description":
Source [Link icon] The title of my link, from [source.title]
And "The title of my link, from [source.title]" was a link to [source.url]
With the new calendar interface, the same event instead shows:
[Email icon] This event was automatically created from an email. [View confirmation]
And [View confirmation] is a link to [source.url]
Am I missing something? Is that a bug on the new interface or is the API documentation deprecated for these fields?
The bug tracker link to that issue: https://issuetracker.google.com/issues/73334552
There was recently a large upgrade of the Google calendar web UI. This happend around October if memory servies.
This looks like a bug to me there have been a few of them asssoicated with the API and the new web UI not being updated and fully tested.
I am going to reach out to my contacts at Google to have someone check this in the mean time would you mind posting this on the issue tracker and pasting me the link? issue tracker

How do I send a message to Telegram that includes a button that prompts the user to forward the message?

Many Telegram bots (e.g., #youtube) have a button you can click on to forward messages sent by the bot. When the user clicks on this button, Telegram opens a contact list that lets the user choose who to forward the message to.
How can I send a button like this? The closest thing I can find is forwardMessage but that expects chat_id target ID as a required parameter. But I won't have this target ID until the user selects who they want to forward to.
If you want to share your content to specific chats, you have 2 options:
Option 1
If your bot has inline_mode enabled you can share content via a button that opens a inline_query in the chat selected. Basically, this is how #youtube bot works. To use this method you need to send an inline button with switch_inline_query as a field (documentation).
Example in Javascript:
bot.sendMessage(msg.chat.id, 'Share:', {
reply_markup: {
inline_keyboard: [[{
text: 'Share with your friends',
switch_inline_query: 'share'
}]]
}
})
This is the same example I use in my bot #livecoinbot, set a bitcoin address and use the share button.
Option 2
You can create a normal inline button or just simply send a link in a normal message, that will prompt the telegram client to share the content. Here is how you do it:
https://t.me/share/url?url=[url-to-send-here]&text=[text]
Example: Click here

Resources