In the previous version of the Microsoft Bot Framework (v1) we were able to get the Skype ID (username) from the Message object. I have now updated to V3 and can no longer get the Skype ID, it returns a random ID in the ID field and the Skype Users name.
I have already built the back end to use the Skype ID and don't want to change that.
Is there anyway to get to the Skype ID?
I did see this in the documentation "In the V3 version of the API a user is represented by a unique user ID per bot (and not for example the Skype ID)." But they didn't explain anything more than that.
Much like Facebook, Skype now provides extra privacy to the user by providing a unique user ID per bot.
Related
I've been using a Telegram BOT to send notifications for a group, and for users.
I already know i can get Chat ID by receiving a message from the user on my bot, using getUpdates.
I also know i can get Group ID using the same method...
But what i really need is:
There is three users in my group.
My bot.
Me.
Another user that didn't sent any messages to my bot so it does not appear on getUpdates
Is it possible to get this third user his ID?
PS: I am the group owner, and also added my bot as Admin...
The third user is a normal user.
Can someone help me?
Thanks!
That's not possible with the offical Telegram Bot API
Possible Workarounds:
Hold a list of your own. If a user is joining (new_chat_member), lefting (left_chat_member), somebody is sending a message in the group, and so on. Check Message for more information.
Check if a user is a member of the group with getChatMember.
Also may be helpful: getChatMembersCount and getChatAdministrators
Relates to Retrieve all chat ids using Telegram bot but 3 years later.
My use case is a bot that notifies chat participants of home automation events. Any user might create his own chat and receive events or send commands.
Currently, it seems that the bot has no option to find the chats that it participates in. Even a potential workaround like using GetUpdates(0) seems to retrieve only new message ids which makes it impossible to get a complete list of chats from looking at the received messages.
Is there a stable solution for doing this?
This is not possible from Telegram's API. Howerver,
A bot will receive a new_chat_members which could be the bot 'joining another group':
new_chat_members -- Array of User -- Optional.
New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
To remember each user/group, you'll have to save each chat/user_id into a database.
The bot will also receive the opposite left_chat_member so you'll know when to delete a database entry.
How can I check is user online or not, if I have users chat Id? I tryed bot.userStatus(myChat); but this is wrong.
Telegram Bot APIs don't offer any methods or object's attribute in order to get the user status, whether if he's online or not.
Your chatbot is able to gather user's information as soon as he wrote a message to the chatbot: these informations are the User's object fields as described into the Telegram Bot API documentation.
According to the available fields, user status (online, offline, etc.) unfortunately is not (yet) available.
According to another question posted here, it seems that getting the user status is possible via Telegram API so that creating a Telegram registered application which is not the same thing of using a Telegram Bot.
For our app I need to find user's Skype ID to connect user in our app with user in Microsoft Bot Framework.
I would like to know Is there any endpoint where I can get Skype ID? I can't find it. I guess the enpoint exists because ifttt.com while using Skype needs connect to my Microsoft account and uses skype.basic scope which is used for getting Skype ID.
I want to get ID like this:
29:1LJQ9JzcpZTXR6ArgCdwtivsGkVjO4rxbDUR_1hdsdf1
Thanks for answer.
Messages from a user come through with the channelAccount record, which has a Skype ID in it. It's somewhat anonymized for the bot, but it's durable for that particular bot.
Are you looking for some other id?
I'd like to set up a authentication through telegram using it's deep linking api.
In order to authenticate, in my app I ask users to click on a link like:
https://telegram.me/myloginbot?start=somesecretkey
If I understand the docs correctly, I should expect the bot to echo back somesecretky to my server.
Now, this step of the docs is unclear to me:
Configure the webhook processor to query Memcached with the parameter that is passed in incoming messages beginning with /start
If I understand correctly, I need to configure myloginbot so that when the user clicks start button on the bot's page, the bot echos back to my server a url containing somesecretkey and some user info. But I don't know how to do so.
In this answer, it is suggested that:
Let the bot retrieve the username by querying the database or key-value storage for unique_code.
But I don't know how can I make the bot query the (presumably remote) database.
So really appreciate your hints.
My understanding to deep linking is this:
You have a database of users. Each user has an ID. Suppose you want your Telegram bot to communicate with user 123. But you don't know his Telegram chat_id (which the bot needs in order to send messages to him). How do you "entice" him to talk to the bot, thus revealing his chat_id? You put a link on a web page.
But the link has to be "personalized". You want each user to press on a slightly different link, in order to distinguish them. One way to do that is to embed user ID in the link. However, user IDs are not something you want to expose, so you generate a (temporary) key associated with each user ID, and embed that key in the link. For example, user 123 has the key abcde. His personalized link will be:
https://telegram.me/myloginbot?start=abcde
Someone clicks on the link, and is led to a conversation with your bot. At the same time (or when he presses the START button), your bot will receive a message:
/start abcde
On receiving that message, the bot sees that abcde is associated with user 123. Telegram chat_id can also be extracted from the message. Now, the bot knows user 123's chat_id, and can send him messages afterwards.
To experiment with deep linking, you need a bot that can handle /start messages, supported by a "datastore" that remembers the key-ID associations. When Telegram docs say "memcache", they just mean something that stores the key-ID associations. For an experiment, it may be as simple as a dictionary, or an associative array. In real life, it may be Memcached (the memory caching software), or a database table.
If you use Python, I recommend taking a look at telepot, a Python framework for Telegram Bot API. It does not do deep linking per se, but it does help you in receiving messages for a bot, and other bot operations in general. I also have an example there demonstrating how to output a personalized link, set up a webhook, and parse the incoming /start command with the key.