This plugin can help you to force your bot users to subscribe your channel before using the bot.
You can install this plugin in any Telegraf Bot.
Install the NPM Plugin
npm i telegraf-fsub
#or
yarn add telegraf-fsub
Import and Use in code
import fsub from "telegraf-fsub"
const botFsub = fsub({
channels : ["@channel"]
});
bot.use(botFsub)
You can pass these options in bot like this
import fsub from "telegraf-fsub"
const botFsub = fsub({
channels: [],
notJoinedMessage: "Hello {user}, You Must Joined <b>{channel}</b>",
enable_inline: true,
parse_mode: "HTML"
});
bot.use(botFsub)
Note : channels option is required without that bot will crash
You can open a Issue for ressolving your problem
You can contribute to this plugin by just opening a pull request.