How to get user id from #username in Telegram using php - php-telegram-bot

Hi i'm working on a Telegram bot and i need to get the id of any one just form his username.
I searched for this question a lot but I did not find a solution and therefore I asked this question here, please help.

With the Bot API you can't. You can use the users.getUsers method from the Telegram APIs (the ones for clients, not for Bots) but it's a bit complicated. Otherwise you can store in a database all user_id and username from users when they start the bot so you'll be able to get the user_id from the username and viceversa.

Related

How to authenticate Tweepy Application to tweet via discord

I am currently developing a discord bot that can post tweets and more. The whole code is basically done all I need to do now is make the user authenticate the app so the bot can post tweets. I searched everywhere and I don't have any idea on how to do it. My goal is to have multiple users in a discord chat use the bot at the same time
From what I understand, you want your bot to have control multiple user's API ?
If so,
Have the user inputs their credentials using a command, (best would be by DM, like ?api XXXXXX)
store this credentials into a database and have your API Caller lookup for a specific API credentials within your DB.

Is approval-based sign-ups possible with Slack?

Normally, I invite new members via. email, that I get from them individually.
Let's say I want to campaign publicly for volunteers to join our community, then what is the best approaches with various level of control?
It is not possible out-of-the-box, but you can develop a custom website, where people can apply for your Slack and enter the name and email address.
You can then forward their request for you to approve (e.g. a page with a table of all open requests where each can be approved or denied or an automatically generated email to you etc).
Finally you can auto-invite every approved user with his email address. The Slack API has an undocumented API function that allows that. Check here for my post about that method.
I have done a similar website for inviting people from a gaming community (Eve Online), where they have to first authenticate themselves with their game login before getting an invite to our Slack. It works pretty well. I made this website with PHP, but basically every server based script language will work.

List of Authenticated Users

I am working on a tool inside of a current iOS app that I only want to be available to a handful of people. The company email addresses are all gmail.
How can I make the app work in a way that, You sign into your google account, and on the server end it will check if you have access or not. If you do, it will then move on to the tool page.
Does Google API have anything on this?
Thanks in advance
Google App Engine has the Users API which you can use to allow people to log in with a Google Account. You can the write server side code to cross check the logged in email address against your whitelist (which may or may not be configurable), and only allow access if the emails match.
Is that the kind of thing you mean?

How do I get a Twitter username based on an email address?

Is there an API (probably provided by Twitter but not necessarily) that will give me the Twitter username for each email address I give it?
Official response from Twitter on this issue is here - http://code.google.com/p/twitter-api/issues/detail?id=353
"This API method is offered in a closed beta at this time, and we are not accepting new partners. However, we're working on the long-term strategy for this method and will keep you in mind when we decide to open it up again. I am sorry for the inconvenience this may cause in the meantime, and please let me know if you have any other questions."
To my knowledge, the Twitter API doesn't expose or otherwise give access to the email address.
I understand your needs, as I also wish this were available, but I believe this is the decision Twitter went with.

Via Google ... What is this?

On Twitter I see people posting stuff like:
Just designed a new flyer check http://mysite.com
And it will say underneath Posted 2 hours ago via Google
I am wondering how they are doing it. Anyone know?
It means they used google buzz.
When an app developer signs up for a Twitter API key, they associate an application name with that key. Then, when that app makes an API call to create a new tweet, the API key is sent along, and Twitter knows to add the "via {APP NAME}" part to the end.
In this case, the user must have updated their Twitter status using some Google application.

Resources