Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting ID through arguments #363

Open
scar-day opened this issue Jan 31, 2024 · 1 comment
Open

Getting ID through arguments #363

scar-day opened this issue Jan 31, 2024 · 1 comment

Comments

@scar-day
Copy link

Hello, is there any function that gives user ID through arguments (for example I write like this: /id @ and it will give ID)

@mircoianese
Copy link
Collaborator

Hello, if you mean that you need to get the ID of users without using BOTs API then you can use unofficial apps (like Plus Messenger on Android or Nicegram on iOS). You will be able to see the User ID in the User profile.
If you are looking instead to create a Telegram BOT that will send you the of users that starts it, you can do something like this:

if (update.message() != null && update.message().text() != null && update.message.text().equals("/start")) {
SendMessage msg = new SendMessage(YOUR_TELEGRAM_ID, "User started the bot: " + update.message().from().id());
bot.execute(msg);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants