Created
December 14, 2016 16:40
-
-
Save mhnabi/b3676004f7a2e891bb8675c246f6f375 to your computer and use it in GitHub Desktop.
This file contains 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 | |
from telebot import types | |
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") | |
markup = types.InlineKeyboardMarkup() | |
playGame = types.InlineKeyboardButton(text='playgame',url='http://simorgh.foxinia.ir',callback_game=None) | |
#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) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment