Post

Referral Bot

بات دعوت

به این بات یک پیام بدهید تا لینک دعوت مخصوص شما را بفرستید
سپس با آن یک کاربر را به بات دعوت کنید

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from balethon import Client
from balethon.conditions import private

bot = Client("TOKEN")


@bot.on_command(private)
async def start(referrer, *, client, message):
    referrer = await client.get_chat(referrer)
    await message.reply(f"You were invited by {referrer}!")


@bot.on_message(private)
async def answer_message(*, client, message):
    referral_link = client.create_referral_link("start", message.author.id)
    await message.reply(
        f"Hello {message.author}\nyou can invite users to this bot using:\n{referral_link}"
    )


bot.run()
This post is licensed under CC BY 4.0 by the author.