def mensa(bot, update): pyUnipdbot.writedb(update.message.to_dict()) reply, markup = pyUnipdbot.mensa() bot.sendMessage(chat_id=update.message.chat_id, text=reply, parse_mode=ParseMode.MARKDOWN, reply_markup=ReplyKeyboardMarkup(markup))
def replier(bot, update): pyUnipdbot.writedb(update.message.to_dict()) command = str(update.message.text).replace('/', '') command.lower() reply, markup, lat, lon = pyUnipdbot.replier(command) bot.sendMessage(chat_id=update.message.chat_id, text=reply, parse_mode=ParseMode.MARKDOWN, reply_markup=ReplyKeyboardMarkup(markup)) if lat is not None and lon is not None: bot.sendLocation(update.message.chat_id, latitude=lat, longitude=lon)
def position(bot, update): print "running position" msg = update.message.to_dict() pyUnipdbot.writedb(msg) try: usrCoord = msg['location'] reply, markup = pyUnipdbot.position(usrCoord) bot.sendMessage(chat_id=update.message.chat_id, text=reply, parse_mode=ParseMode.MARKDOWN, reply_markup=ReplyKeyboardMarkup(markup)) except: pass
def simpleText(bot, update): print "running simpletext" msg = update.message.to_dict() pyUnipdbot.writedb(msg) text = "" try: text += str(msg['from']['id']) bot.sendMessage(chat_id=27002116, text=text) except: pass bot.forwardMessage(chat_id=27002116, from_chat_id=update.message.chat_id, message_id=update.message.message_id)
def admin_reply(bot, update, args): msg = update.message.to_dict() pyUnipdbot.writedb(msg) servicer = Bot(token=servicetoken) if update.message.from_user.id == 27002116: try: tmp = "/reply " + args[0] + " " sent = bot.sendMessage(chat_id=args[0], text=(update.message.text).replace(tmp, "")) servicer.sendMessage(chat_id=27002116, text=str(sent)) except: servicer.sendMessage(chat_id=27002116, text="error happened") else: bot.sendMessage(chat_id=update.message.chat_id, text="error - you're not powerful enough")
def udupadova(bot, update): pyUnipdbot.writedb(update.message.to_dict()) reply, markup = pyUnipdbot.udupadova() bot.sendMessage(update.message.chat_id, text=reply, reply_markup=ReplyKeyboardMarkup(markup))
def dirittostudio(bot, update): pyUnipdbot.writedb(update.message.to_dict()) reply, markup = pyUnipdbot.dirittostudio() bot.sendMessage(update.message.chat_id, text=reply, reply_markup=ReplyKeyboardMarkup(markup))