I have a Telegram channel and a Telegram bot using Node.js and PSQL. With a command (for example /how), I need to return to the user the number of user which has been invited to the channel by this user (and has joined).
How can I retrieve this list of users ?
If by "invited" you mean users who sent others a link to the channel then Telegram API does not provide such functionality.
However, channel administrators can add users to the channel and those should be sent as regular Message updates with new_chat_members field set, all you have to do is log those updates to the database and then fetch it with your command.
Related
So the discord bot (Discord v12) I'm designing in nodejs has a command that must go through a DM (it's a silent auction bot so the bid messages being sent as bids can't be seen). Since I'm designing the bot to be able to be used on multiple servers I need a way to assign the server ID from the DM message so the bot knows the bid is for that particular server's auction. Since it's a DM I can't pull the server ID from the message itself.
The only way I've thought to accomplish this is by having the members logged into a voice channel of the server, but I can't figure out a way to pull the server ID from the voice channel itself. Is there a way to pull the voice channel ID a member ID is currently logged into and pull the server ID from that?
You can get information regarding a voice channel where the user is logged with the VoiceState object.
You can get it from a member's .voice attribute.
I am making a telegram bot using nodeJs for a telegram group management I need to give referral points to a user who invites more users using the invitation link so I was finding a solution to check the new user has joined using which link so I can add points to that user.
I have a telegram group with several human members and a bot. This bot sends regular status updates to the group. I do this with a simple curl command.
https://api.telegram.org/bot<MYBOT-ID>/sendMessage?chat_id=<MYCHAT-ID>=&text=hello%20world
Is there a possibility that the bot sends a message to a specific user in the group, e.g. to inform about a failure. The other members of the group should of course not see or hear this.
You can use "user_id" instead of "chat_id" to send the message to the PV of users instead of sending message in the group
https://api.telegram.org/bot<MYBOT-ID>/sendMessage?chat_id=<USER-ID>=&text=hello%20world
I'm creating a telegram bot. I need to keep track when a user is added and who added it.
How can I do it using the telegram APIs?
In groups with the Telegram API, you can call the new_chat_members message and store the user information into an array or DB.
https://core.telegram.org/bots/api
My bot is running in perfect conditions when I use it trought funpage.
But what I want to know is if we can start the conversation with the user instead user with it.
For example: The user is on a page that his next interation is talk with my BOT. But i donĀ“t want my clients start I want my bot starts.
At this case we can consider that user already authorized my app.
Not if this is their first messenger interaction with you.
When you message a user, you're sending a message to a user id that is page scoped.
So unless they've previously messaged your page, there's no way for you to get their id
The id must be an ID that was retrieved through the Messenger entry points or through the Messenger webhooks (e.g., a person may discover your business in Messenger and start a conversation from there.
These IDs are page-scoped IDs (PSID). This means that the IDs are unique for a given page.
If you have an existing Facebook Login integration, user IDs are app-scoped and will not work with the Messenger platform.
(see https://developers.facebook.com/docs/messenger-platform/send-api-reference)