Telegram.Bot, C# (6) - Force a user to subscribe a channel (2022)

preview_player
Показать описание
Watch my new video with the new version 22, 2025:

Hello and welcome back.

I added a simple command to check if a user is part of one or more groups, otherwise, we force the user to follow them if he wants to use the bot.

This will be useful for you to advertise the channels you want.

The logic I entered, for each message received from the bot, checks if the user is part of the groups we want, if he is part, the bot responds normally to the commands entered, if instead the user is not part of the groups, the bot asks for the subscription in loop otherwise it does not continue and does not respond to commands.

To work, the bot must be included in all the groups you want to verify.

This video is part of my playlist:

You can find the script in my GitHub Page:

If you like my content, consider subscribing to my channel, you will help me grow and create better and better videos.
Рекомендации по теме