Snippets Collections
import os
import telebot
import main
from dotenv import load_dotenv
load_dotenv()

API_KEY = os.environ.get('TELEGRAM_API_KEY')
bot = telebot.TeleBot(
    API_KEY, parse_mode=None)


@bot.message_handler(commands=['start', 'help'])
def greet(message):
    bot.reply_to(message, "Hey My G")


@bot.message_handler(commands=['btc', 'BTC', 'bitcoin', 'BITCOIN'])
def prices(message):
    bot.reply_to(message, main.get_cmc_data('BTC'))


@bot.message_handler(commands=['eth', 'ETH', 'ethereum', 'ETHEREUM'])
def prices(message):
    bot.reply_to(message, main.get_cmc_data('ETH'))


@bot.message_handler(commands=['wagmi', 'WAGMI'])
def prices(message):
    bot.reply_to(message, main.get_cmc_data('WAGMI'))


bot.polling()
print("bot running...")
star

Mon Mar 28 2022 18:27:30 GMT+0000 (UTC) https://www.youtube.com/watch?v=NwBWW8cNCP4

#python #telegram #bot

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension