What the heck am i doing wrong?!?!
On replit and the bot wont even give me a ping/pong. No errors but when i go to start it stops immediatelyimport os
import telebot
#instantiate a telegram client
key = os.environ.get('2117146323:AAG-8cLubDLtchPUhGlUrAN6JUzcMDhZ8qY')
bot = telebot.TeleBot(key)
#ping/pong
u/bot.message_handler(commands=['ping'])
def ping(message):
bot.reply_to(message, "pong")
Submitted November 23, 2021 at 06:11PM by No_Possible_9206
on r/TelegramBots via https://www.reddit.com/r/TelegramBots/comments/r0i03q/what_the_heck_am_i_doing_wrong/ Backup by @tmebackup A @rtptme project - Other backups: http://pixly.link/tme
On replit and the bot wont even give me a ping/pong. No errors but when i go to start it stops immediatelyimport os
import telebot
#instantiate a telegram client
key = os.environ.get('2117146323:AAG-8cLubDLtchPUhGlUrAN6JUzcMDhZ8qY')
bot = telebot.TeleBot(key)
#ping/pong
u/bot.message_handler(commands=['ping'])
def ping(message):
bot.reply_to(message, "pong")
Submitted November 23, 2021 at 06:11PM by No_Possible_9206
on r/TelegramBots via https://www.reddit.com/r/TelegramBots/comments/r0i03q/what_the_heck_am_i_doing_wrong/ Backup by @tmebackup A @rtptme project - Other backups: http://pixly.link/tme
reddit
What the heck am i doing wrong?!?!
On replit and the bot wont even give me a ping/pong. No errors but when i go to start it stops immediately import os import...
What am i doing wrong here?! Price bot for a specific token
Help please. I'm using python on visual studios.import telebot
import requests
#instantiate a telegram client
API_KEY = ('My API Key')
bot = telebot(API_KEY, parse_mode=None)# called whether there is a message in the chat
u/bot.message_handler(commands=["price"])
def price(message):# Generating the URL
coingecko = "https://api.coingecko.com/api/v3/simple/price?ids=token&vs\_currencies=usd"
# getting data from coingecko
r = requests.get(url=coingecko)
# converting data to json
data = r.json()
# Store the price in a variable
price = data["token"]["usd"]
# Convert the scientific notation to a float with 12 decimal places
price = format(price, ".12f")
# sending the price to the chat
bot.reply_to(message, "{price}")
bot.polling()
Submitted November 23, 2021 at 07:50PM by No_Possible_9206
on r/TelegramBots via https://www.reddit.com/r/TelegramBots/comments/r0k6ys/what_am_i_doing_wrong_here_price_bot_for_a/ Backup by @tmebackup A @rtptme project - Other backups: http://pixly.link/tme
Help please. I'm using python on visual studios.import telebot
import requests
#instantiate a telegram client
API_KEY = ('My API Key')
bot = telebot(API_KEY, parse_mode=None)# called whether there is a message in the chat
u/bot.message_handler(commands=["price"])
def price(message):# Generating the URL
coingecko = "https://api.coingecko.com/api/v3/simple/price?ids=token&vs\_currencies=usd"
# getting data from coingecko
r = requests.get(url=coingecko)
# converting data to json
data = r.json()
# Store the price in a variable
price = data["token"]["usd"]
# Convert the scientific notation to a float with 12 decimal places
price = format(price, ".12f")
# sending the price to the chat
bot.reply_to(message, "{price}")
bot.polling()
Submitted November 23, 2021 at 07:50PM by No_Possible_9206
on r/TelegramBots via https://www.reddit.com/r/TelegramBots/comments/r0k6ys/what_am_i_doing_wrong_here_price_bot_for_a/ Backup by @tmebackup A @rtptme project - Other backups: http://pixly.link/tme