بتل کد Battle Codeدارد باز می‌شود…

جواب «Buttons for Real Users» چالش 7 از جلسه‌ی 17

سؤال

آدم‌های واقعی دکمه را دوست دارند. /start جواب Welcome! Pick a command below. بدهد و دکمه‌های /help و /about را بگذارد؛ /help → Commands: /start /help /about؛ /about → I am Robo, made in a Battle Code class.؛ بقیه → Press a button below.. (در بررسی جواب، دکمه‌ها بعد از پیام یک خط‌اند: [/help] [/about].)

راهنما

bot.buttons([...]) را داخل reply، در راه /start، قبل از return بنویس.

یک جواب درست

import bot


def reply(text):
    if text == "/start":
        bot.buttons(["/help", "/about"])
        return "Welcome! Pick a command below."
    if text == "/help":
        return "Commands: /start /help /about"
    if text == "/about":
        return "I am Robo, made in a Battle Code class."
    return "Press a button below."


bot.run(reply)

اول خودت امتحان کن؛ جواب‌های دیگر هم قبول است. برگرد و خودت حلش کن