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.
Related
I am in a private Telegram channel (of which I'm not an admin), and I need to create a bot which forwards the messages I get in that channel. I cannot make the bot a channel admin.
I've read the API, and couldn't find a hint to serve this purpose.
Is there a way maybe of letting my bot authenticate in telegram using my credentials? That way it receives the messages and can forward them.
Is it even possible to automate this process using a Telegram bot at all?
Thanks
If you need to make The Bot is Admin you must be the Admin as well
Thanks
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
The Discord bot is going to add a role to the user that sent the DM message.
Currently, I have the user's ID and I have the role ID. I don't know what steps I need to take in order to add the role to the user.
The messages are in a DM so I went and did this:
let userId = message.author;
somethingHere.addRole('roleId#');
What is that missing piece before the .addRole that I need?
.addRole is a method of GuildMember, so in order to use it you need to get the member object of that user (otherwise the bot couldn't know in which guild it should do it.)
If you have only one guild stored somewhere, you can do <Guild>.member(message.author).addRole('role id'), otherwise you'll need a way to figure out which guild they want the role in.
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
I create a bot with BotFather.
What is the way to disable research bot? I don't want other users start a conversation with my bot.
Simply create a whitelist from Telegram IDs (include your own account Id) and ignore another updates.
Telegram users uniq ID are receive with each update and you can find it in this path:
update.chat.id
I think there is no other way.