Sebastián

Generation

generate functionThu, 13 Jul 2023

Crear un bot para Telegram que tenga la capacidad de realizar operaciones matemáticas Basicas de manera profesional

#Telegram Bot Integration import telebot from telebot import types bot = telebot.TeleBot("TOKEN") #Claves keyboard1 = telebot.types.ReplyKeyboardMarkup(True, True) keyboard1.row('/start') keyboard1.row('Suma', 'Resta') keyboard1.row('Multiplicacion', 'Division') #Funciones @bot.message_handler(commands=['start']) def send_welcome(message): bot.reply_to(message, "¿Qué desea hacer?", reply_markup=keyboard1) #Suma @bot.message_handler(commands=['Suma']) def send_welcome(message): bot.reply_to(message, "Dijite dos numeros", reply_markup=keyboard1) @bot.message_handler(func=lambda message: True) def echo_all(message): try: a = int(message.text)

Want to kickstart your project?Use the new AI Studio to create your code