Никита Шишлов
Мастер
(1009)
1 месяц назад
import telebot
import random
bot = telebot.TeleBot("(token)")
@bot.message_handler(commands=['start', 'help', 'main', 'hello'])
def main_(message):
bot.send_message(message.chat.id, "hello")
@bot.message_handler(commands=['blue_or_red'])
def blue_or_red(message):
b = ['blue', 'red', 'green']
tabletka = random.choice(b)
bot.send_message(message.chat.id, tabletka)
bot.infinity_polling()
вот код:
import telebot
import random
b = ['blue' , 'red']
tabletka = random.choice(b)
bot = telebot.TeleBot("(token)")
@bot.message_handler(commands=['start', 'help','main','hello'])
def main_(message):
bot.send_message(message.chat.id,"hello")
@bot.message_handler(commands=['blue_or_red'])
def blue_or_red(message):
bot.send_message(message.chat.id, tabletka)
bot.infinity_polling()