-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
My bot can't get 'new_chat_members' event - only working for bots created with botfather for testing, not real users #1161
Comments
Hello. |
Without administrator rights, it does not track this event. |
Hi @VDS13 😊🙏 thanks for your answer. And do you know why it works perfectly for test bots created under my account and joining the group, but not with other users? |
Yes they already are |
Is the group public or private? |
@VDS13 |
Strange. |
yes exactly ! i agree it is weird :) |
Show a piece of code from the beginning to the |
bot.on('new_chat_members', (msg) => { nothing is coming. I want channel id through my bot like https://t.me/username_to_id_bot bot is doing. |
There are no others in the code before this handler (let's say |
const TelegramBot = require('node-telegram-bot-api'); const bot = new TelegramBot(token, { polling: true }); I am trying to get channel_id when my bot joins any channel. how can I do it? can you give me any solution |
If your const TelegramBot = require('node-telegram-bot-api');
const token = '<bot_token>';
const bot = new TelegramBot(token, { polling: true });
bot.on('new_chat_members', (msg) => {
console.log(msg)
});
bot.on('message', (msg) => {
console.log(msg)
}); |
Still not working, I am getting message when i send to bot, but while adding bot to any channel I am not getting any channel_id, new-chat_members not working. This is working for groups but not channels. |
Hi @VDS13 import TelegramBot from 'node-telegram-bot-api'; // Replace 'YOUR_BOT_TOKEN' with your actual bot token // Event handler for new chat members // Process new members // Function to process new members // Event handler for messages // Start the bot |
Obviously I'm not the only one with this problem. Telegram maybe changed something and your event handler has to be updated ? |
@dev-anshu |
that's weird, anyway you can try go to botFather, use /mybots -> select your bot -> Gruop Privacy -> Turn off |
Is there any dev knowing if the code is still working ? |
So now, use "chat_member" for know if user join or left. This warning is from 3 years ago, so maybe now is deprecated for normal users. |
You can try the following, it works for me. It detects both input and output in groups. let TelegramBot = require('node-telegram-bot-api');
let bot = new TelegramBot('YOUR_TOKEN', { "polling": true })
bot.on('chat_member', (memberStatus) => {
console.log(memberStatus)
}) This code would return something similar to the following image |
Thanks for your answers @danielperez9430 and @IscoV 😊👍 When have you tested those lines of code? In a group? Why would my bot not see anything and yours yes? Ps: node-telegram-bot version is 0.64.0 |
I used: let TelegramBot = require ('node-telegram-bot-api'); // Replace 'YOUR_BOT_TOKEN' with your actual bot token // Event handler for new chat members }); // Start the bot |
At the time of execution, it should not show anything. It should only show the information when adding or joining a user/bot to the group. |
@IscoV Yes yes, I'm talking about this. I added a bot and a user joined for testing. Nothing shows. |
I tested it before sending it. Else, try to enable the update manually. Paste the following URL in your browser and replace the YOUR_BOT_TOKEN
|
'new_chat_members' event sometimes works, sometimes it doesn't |
You too? |
Thanks but I don't understand what you mean? |
Seems there is no solution till now. Cheers |
hey all, I confirm there is something weird regarding the messages of the users who join in a group. Until two days ago the messages were showed, now they aren't. The result is that the following function to ban users who join the group and forward a message doesn't work:
|
Solution here: #1139 (comment) |
Hi guyz,
My bot can't get 'new_chat_members' event - only working with test-bots created on my account with botfather for testing, not with real users joining the group. Any idea why ???
I use the bot.on('new_chat_members', (msg) => {
...
Thanks in advance for your advices
@VDS13 @sidelux Could you help ? thanks in advance
Y.
The text was updated successfully, but these errors were encountered: