telebot icon indicating copy to clipboard operation
telebot copied to clipboard

a way that let the bot "unuseable" until the user subscribe to a specific channel

Open xMA3x opened this issue 4 years ago • 3 comments

How i can do this in Telebot ? and how to make a code, that while the user not in the channel and keep talking to the bot the bot till him that he has to subscribe to the channel

and when he does the subscribe, the bot work

xMA3x avatar Mar 27 '21 18:03 xMA3x

in here we mostly use command if I remember correctly, something like "/start" to trigger the event in your code,

trigger event here meaning that you write a function in the "/start" command, so when the user click "/start" or "subs" then you trigger subscribe to the channel

TeLoardBruh avatar Mar 29 '21 03:03 TeLoardBruh

in here we mostly use command if I remember correctly, something like "/start" to trigger the event in your code,

trigger event here meaning that you write a function in the "/start" command, so when the user click "/start" or "subs" then you trigger subscribe to the channel

you don't understands me well, i will make it clear as an example

*user uses the bot*
user: /start 
bot: you have to sub to the channel "x" to make the bot work
user: /meme (or any other commnd)
bot: you have to sub to the channel "x" to make the bot work

*user subs to the channel*
user in the bot: /start
bot: Hello there, how i can make you happy today
user: /meme
bot: *sends a meme" 

did you get the idea? i need the bot command not be working until the user subs to the channel

xMA3x avatar Mar 29 '21 06:03 xMA3x

u need a function to trigger or use conditional statement, if user != subs then disable the command

TeLoardBruh avatar Mar 30 '21 09:03 TeLoardBruh