Created
December 13, 2016 20:54
-
-
Save mhnabi/4b07d27219957edfadb3c1bc0d822a6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telebot | |
import logging | |
with open ("key.txt", "r") as key: | |
token = key.read().strip() | |
API_TOKEN = token | |
bot= telebot.TeleBot(API_TOKEN) | |
@bot.message_handler(commands=['start', 'help']) | |
def send_welcome(message): | |
reply = message.from_user.id if not None else '' | |
name = message.from_user.username if not None else '' | |
fname = message.from_user.first_name | |
lname = message.from_user.last_name if not None else '' | |
chat1 = message.chat.id if not None else '' | |
payam = " سلام "+str(name) | |
bot.reply_to(message,payam) | |
@bot.message_handler(commands=['startgame']) | |
def send_welcomee(message): | |
chat_id=message.chat.id | |
bot.send_game(chat_id, "Calc1") | |
bot.set_webhook("http://162.223.94.227:500/289951262:AAFV1300eDu-7XePHAqAFEiGonarw5Fggxc") | |
logger = telebot.logger | |
telebot.logger.setLevel(logging.DEBUG) | |
#bot.polling(none_stop=False, interval=0) //we cant use webhook & polling at same time | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment