Home How to How to Create Telegram Refer and Earn Bot in Just 5 minutes

How to Create Telegram Refer and Earn Bot in Just 5 minutes

We all know how useful is Telegram bots which automate our work on Telegram. There is some public bot that is free to use but we need some customized bot for different purposes. Well, it’s easy to create some beginner bot to interact with the audience and give basic information.

Not to mention that most of the customizable bots involve heavy coding and runs on a paid server. So it requires skill as well as a small investment. But if I say you don’t have to go through these hassles and still able to create a customized bot. Here we are going to create a Refer and Earn bot which you might be knowing.

Also read: Anyone Can Create Telegram Bot With Advanced Features

What is Telegram Refer and Earn Bot

Telegram refer and earn bot basically a bot which pays users in exchange for referring the bot to some other users. And the bot owner will earn by getting a free subscription to their channels. The bot is designed in such a way that you have to subscribe to the mentioned channel before earning from the bot and you can earn from the bot as long as you are subscribed to the mentioned channel.



The procedure of bot creation obviously involves coding which is why these bots are sold for a good amount. But from now on, you don’t have to pay for this bot. Before proceeding further first checkout, how this bot works and what are the features of this bot.

Refer & earn bot: https://t.me/DJI_Refer_Earn_bot?start=Bot2261098

So now you know that this bot offers everything which you want so, without wasting time let’s jump into the steps of bot creation.

Steps to Create Refer and Earn Bot

Follow each step sequentially otherwise you end up blaming me. You can follow these steps both on a smartphone & PC. I am using a PC to create this tutorial to make things clear.

Step 1: Create a bot using botfather and customize your description, bio & bot pic as you like. Here you have to choose a unique username and once the bot is created an API key will be generated. Copy the API ley for future steps.

create telegram bot

Step 2: Now Go to the bots.business and log in using any email id.

Step 3: Tap on “NEW BOT” button and then paste the API token in the token field. You can name the bot whatever you like.

refer and earn bot

Step 4: Once the bot is created click on the “LAUNCH BOT” button.



Step 5: Now go to the hamburger menu at the top left and tap on <Libs>. Click on all resources one by one and install them.

refer and earn bot

this is a very important step because without this none of the commands will execute.

Also read: How to Create Telegram Bot without any Programming Language

Step 6: On the top of the page you can see different tabs. Switch to the next tab and tap on “NEW COMMAND”. The first command is /start so, type /start in the command box and scroll down to edit BJS.

refer and earn bot

Step 7: When you tap on edit bjs, a new window will open where you have to paste the below code. This code is designed for my channel so you have to replace my channel with yours.

var button = [{ title : "✅CHECK" , command : "✅CHECK" }]
Bot.sendInlineKeyboard(button , "*🛡 Subscribe Our Channels If You Want To Start The Bot And Earn From It: \n\n➤ @DealsJunctionIndia\n\n☑️ Done Subscribed! Click ✅CHECK*")
function hello(message) {
var greetings = ""

Bot.sendMessage(greetings + message)
}

function doTouchOwnLink() {
Bot.sendMessage("*You're Trying To Invite You're Self ❌*")
}

function doAttracted(channel) {
hello("Referal: " + channel)
}

function doAtractedByUser(refUser) {
hello("")
var balance = Libs.ResourcesLib.anotherUserRes("balance", refUser.telegramid)
balance.add(0.5)
Bot.sendMessageToChatWithId(refUser.chatId, "*🏧 New Referral : +0.5 ₹*");
}

function doAlreadyAttracted(){
Bot.sendMessage("*You Already Started The Bot ❌*");
}

var trackOptions = {
onTouchOwnLink: doTouchOwnLink,
onAttracted: doAttracted,
onAtractedByUser: doAtractedByUser,
onAlreadyAttracted: doAlreadyAttracted
}

Libs.ReferralLib.currentUser.track(trackOptions);

Step 8: Similarly you have add multiple commands to run this bot. Below you can see the command name followed by code. Add one by one each command and save it.



✅CHECK

let stat = Bot.getProperty(""+user.telegramid+"");

if (stat=="ban"){
Bot.sendMessage("*You're Ban From Using The Bot ❌*");
}else{

let channel = "@dealsjunctionindia";
let id = user.telegramid
Api.getChatMember({ 
chat_id : channel,
user_id : id,
on_result :"check"})
}

Note: Replace this with your channel username

check

var user = options.result.status;
User.setProperty("status" , user, "string");
if (user=="member" | user =="administrator" | user=="creator"){
Bot.runCommand("main_menu")
User.addToGroup("user")
}

if (user=="left"){
Bot.sendMessage("*❌ Must join all channels*")
}

🎁 Bonus

function canRun(){
var last_run_at = User.getProperty("last_run_at");
if(!last_run_at){ return true }

var minutes = (Date.now() - last_run_at) /1000/60;

var minutes_in_day = 12 * 60
var next = minutes_in_day - minutes
var wait_hours = Math.floor(next / 60)
next -= wait_hours * 60
var wait_minutes = Math.floor(next)
var seconds = Math.floor((next - wait_minutes) * 60)
if (minutes < minutes_in_day) {
Bot.sendMessage("*📛 You have already received a bonus Today\n\n▶️ Come Back After ⏳ "+wait_hours+" h "+wait_minutes+" m " 
+ seconds+ " s*" );
return
}
return true;
}

if(!canRun()){ return }
User.setProperty("last_run_at", Date.now(), "integer");

let balance = Libs.ResourcesLib.userRes("balance")
balance.add(0.25)
Bot.sendMessage(
"*🎁 Congrats , you Received 0.25 ₹*"
)




Auto

var withdrawn = Bot.getProperty("totalWithdrawn");
withdrawn = parseFloat(withdrawn); 
var wallet = User.getProperty("PaytmWallet");
var balance = Libs.ResourcesLib.userRes("balance")
if(data.message < 20 ){
Bot.sendMessage("_❌ Minimum withdraw 20_")
}else{
if(data.message > balance.value()){
Bot.sendMessage("_❌ Maximum withdraw "+balance.value().toFixed(6)+" ₹_")
}else{
Bot.sendMessage("*✅ Withdrawal sent\n\n💳 Transaction Details :\n 💰Amount : "+data.message+" ₹\n💼 wallet : "+wallet+"\n\n⛔️ May be it will take upto 24 hours*")
balance.add(-data.message)
Api.sendMessage({ 
chat_id: "@DEalsJunctionIndia", 
text: "*🔋 New Approved Payout\n\n▪️ Status : Confirmed\n▪️ User Id :* "+user.telegramid+"\n*▪️ Amount :* "+data.message+" TRX\n\n*♦️ Paid Address ♦️\n "+wallet+"\n\n✅ Bot @bot*" , 
parse_mode: "Markdown"})
}
}

Note: Replace this with your channel username

Also read: 10 best Telegram channel lists

💲Withdraw

let stat = Bot.getProperty(""+user.telegramid+"")
let wdinfo = Bot.getProperty("wdInfo")
if (stat=="ban"){
Bot.sendMessage("*You're Ban*")
}else{
let balance = Libs.ResourcesLib.userRes("balance")
let withdrawn = Libs.ResourcesLib.userRes("withdrawn")
var wallet = User.getProperty("PaytmWallet")
if( wallet == undefined ){
Bot.sendMessage("_❌ wallet Not set_")
}else{
if (balance.value() < 20){
Bot.sendMessage("_❌ You have to earn at least 20 ₹ !_")
}else{
Bot.sendMessage("*📤 Enter Amount in ₹*")
Bot.runCommand("auto")
}
}}

⚙️Set wallet

let wallet = User.getProperty("PaytmWallet")
User.setProperty("PaytmWallet" , data.message ,"string")
Bot.sendMessage("*✅ Paytm wallet set To :* "+data.message+"")




Ask

let Ask = User.getProperty("Ask")
User.setProperty("Ask" , data.message ,"string")
Bot.sendMessage("*📩 Message sent to admin as :* "+data.message+"")

💰 Balance

var balance = Libs.ResourcesLib.userRes("balance")
var lib = Libs.ReferralLib
var refList = lib.currentUser.refList.get();
Bot.sendMessage("*🤴 User : "+user.first_name+"\n\n💰 Balance : "+balance.value().toFixed(2)+" ₹\n\n⚜️Refer And Earn More*")

👫 Referral

let stat = Bot.getProperty(""+user.telegramid+"");

if (stat=="ban"){
Bot.sendMessage("*You're Ban*");
}else{

let res = Libs.ResourcesLib.userRes("referral");
let reflink=Libs.ReferralLib.currentUser.getRefLink("DJI_Refer_Earn_bot","Bot");
let lib = Libs.ReferralLib
var refList = lib.currentUser.refList.get();
Bot.sendMessage("*⏯️ Total Invites : "+refList.length+" Users\n\n⛔️ Per Referral 0.5 ₹\n\n🔗 Referral Link ⬇️\n"+reflink+"*");

}

Note: Replace the marked text with your bot username.

main_menu

var user = User.getProperty("status");
if (user=="member" | user =="administrator" | user=="creator"){
var balance = Libs.ResourcesLib.userRes("balance");
var withdrawn = Libs.ResourcesLib.userRes("withdrawn");
var ref = Libs.ResourcesLib.userRes("referral");
var msgid = User.getProperty("msgid")
Api.deleteMessage({
message_id : msgid
})
Bot.sendKeyboard("💰 Balance\n👫 Referral,🎁 Bonus,💲Withdraw,\n⚙️Set wallet,📞Support", "*▶️ Refer and Earn Cash*")
}
if (user=="left"){
Bot.runCommand("/start");
}

📞Support

let Ask = User.getProperty("Ask")
var button = [{ title : "✏️Write me" , command : "Ask" }]
Bot.sendInlineKeyboard(button , "*📫 Last Question :* "+Ask+"")

Step 9: Now that all command is set, the final step is to make the bot admin of the channel which you are going to promote.

If everything went bouncer over your head then you can also watch this video where everything is explained stepwise. But the only problem is that everything is explained in the Hindi language.

Final Words

Now Start your bot and check if everything is working as it was with my refer & earn bot. If you face any kind of difficulty then please drop a comment below and we will try to sort it out. If you want to support us then join our Telegram Deals channel where we post the best affiliate links.

Nitesh Rajputhttps://www.techscanner.in
I Love technology and the way it is transforming our lives, call me a geek!! Apart from that, I spend my time playing games, watching movies & most importantly the Painting. Reading books is one of my best sources of inspiration.

4 COMMENTS

Subscribe
Notify of
guest
4 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
hfhjr
hfhjr
January 16, 2021 5:43 pm

Bro mera Joined Button Kaam nahi Kar raha

hfhjr
hfhjr
January 14, 2021 3:21 pm

bro 2 check button kyo

REACH OUT TO US

105FansLike
155FollowersFollow
24FollowersFollow
15,800SubscribersSubscribe

Most Popular

Best deals on Smartphones, TVs, and more Electronics – Amazon Great Republic Day sale

Amazon has just kicked off the Great Republic Day sale for offering great deals. People have the option to grab deals on smartphones, LED...

WhatsApp Delays New Privacy Policy by 3 Months after Worldwise Criticism

A few weeks back WhatsApp pushed the new policy update notification. As per this policy, WhatsApp gave Facebook full permission to use WhatsApp data....

Top 10 Signal Messenger Tips and Tricks to Use in 2021

After the latest WhatsApp privacy policy update, everyone is looking for the best alternative. Since the major issue here is privacy & security so,...

Whatsapp Privacy Policy Update: People are Shifting to Telegram & Signal

Whatsapp is again in the news due to its new privacy policy update. Earlier this week, WhatsApp started rolling out in-app notifications to Android...
4
0
Would love your thoughts, please comment.x
()
x