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

import telebot from telebot import types TOKEN = '958169566:AAGb_8TKQ_aG6A7w-YWmj2P9p2Zgjdv9YIo' bot = telebot.TeleBot(TOKEN) def add(a, b): return a + b def subt(a, b): return a - b def mult(a, b): return a * b def div(a, b): return a / b @bot.inline_handler(lambda query: len(query.query) > 0) def query_text(query): try: if query.query == "/help": bot.send_message(query.from_user.id, "Usa los siguientes comandos: \n- /add \n- /subt \n- /mult \n- /div") return if query.query == "/add": markup = types.InlineKeyboardMarkup() b

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