Commands Bot
بات کامندها
این بات 4 تا دستور داره
/start
/help
/say_hello
/count_to_ten
اون ها رو تست کنید
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from balethon import Client
from balethon.conditions import private
bot = Client("TOKEN")
@bot.on_command(private)
async def start(*, message):
await message.reply(
"Hello, I'm the commands bot\nUse /help to see my commands"
)
@bot.on_command(private, name="help")
async def help_command(*, message):
await message.reply("/say_hello\n/count_to_ten")
@bot.on_command(private)
async def say_hello(*, message):
await message.reply("Hello my dear and precious user!")
@bot.on_command(private)
async def count_to_ten(*, message):
counting_message = await message.reply(
"I will start to count to ten now"
)
for i in range(1, 11):
await counting_message.edit_text(str(i))
bot.run()
پست قبلی: Downloader Bot
پست بعدی: Conversation Bot
This post is licensed under CC BY 4.0 by the author.