I want to send a link to a channel by a bot for join to another channel and check who is joined with this link
You should set your bot as administrator of this two channels then call this function:
getChatMember("#channelusername", "user_id")
which #channel_username is the second channel username and user_id is the user_id of the person who joined the second channel. But notice that you need user_id of the person who joined to the channel, usually this is done by a bot. When user comes to the bot, your bot will have his username so you have his user_id and you can use getChatMember function.
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.
How can I get information about what groups does my bot belong to. My bot is an admin in 10 channel and I want to get my channel users list and chatId for save to db. How can I do that in nodejs?
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 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.
I am trying to create a bot that checks if a user has joined a channel and if it is true then reply an automatic message.
Any ideas? Thanks in advance.
You can use getChatMember method with administer permission.
P.S. remember to put both chat_id and user_id into the request.