def start(chat_id, u_id, first): if not first: l = getLanguage(chat_id) rpl = [] if bds.getEnabled(chat_id): return [toDict(chat_id, l.is_enabled)] bds.setEnabled(chat_id, True) bds.checkChat(chat_id) l = getLanguage(chat_id) kb = getKb(chat_id, 'main', u_id=u_id) if (len(kb) != 1): adm = bds.getAdm(chat_id) keyboard = makeKb(kb[0], resize_keyboard=True) rpl.append(toDict(chat_id, l.iniciar_msg, replyMarkup=keyboard)) keyboard = makeKb(kb[1], resize_keyboard=True, selective=True) rpl.append( toDict(chat_id, l.start_msg, replyTo=adm[2], replyMarkup=keyboard)) else: keyboard = makeKb(kb[0], resize_keyboard=True) rpl.append(toDict(chat_id, l.start_msg, replyMarkup=keyboard)) return rpl bds.setFirst(chat_id) bds.setEnabled(chat_id, True) kb = makeKb(getKb(chat_id, 'first')[0], resize_keyboard=True) rpl = [] rpl.append( toDict(chat_id, 'Im the PlayHangmanBot, please choose a language:', replyMarkup=kb)) rpl.append(toDict('-27626712', 'Novo chat criado: ' + chat_id)) return rpl
def start(chat_id, u_id, first): if not first: l = getLanguage(chat_id) rpl = [] if bds.getEnabled(chat_id): return [toDict(chat_id, l.is_enabled)] bds.setEnabled(chat_id, True) bds.checkChat(chat_id) l = getLanguage(chat_id) kb = getKb(chat_id, 'main', u_id = u_id) if (len(kb) != 1): adm = bds.getAdm(chat_id) keyboard = makeKb(kb[0], resize_keyboard = True) rpl.append(toDict(chat_id, l.iniciar_msg, replyMarkup = keyboard)) keyboard = makeKb(kb[1], resize_keyboard = True, selective = True) rpl.append(toDict(chat_id, l.start_msg, replyTo = adm[2], replyMarkup = keyboard)) else: keyboard = makeKb(kb[0], resize_keyboard = True) rpl.append(toDict(chat_id, l.start_msg, replyMarkup = keyboard)) return rpl bds.setFirst(chat_id) bds.setEnabled(chat_id,True) kb = makeKb(getKb(chat_id, 'first')[0], resize_keyboard = True) rpl = [] rpl.append(toDict(chat_id, 'Im the PlayHangmanBot, please choose a language:', replyMarkup = kb)) rpl.append(toDict('-27626712', 'Novo chat criado: '+chat_id)) return rpl
def stop(chat_id): l = getLanguage(chat_id) bds.setEnabled(chat_id, False) keyboard = makeKb(getKb(chat_id, 'main')[0], resize_keyboard=True) return [toDict(chat_id, l.stop_msg, replyMarkup=keyboard)]
def stop(chat_id): l = getLanguage(chat_id) bds.setEnabled(chat_id, False) keyboard = makeKb(getKb(chat_id, 'main')[0], resize_keyboard = True) return [toDict(chat_id, l.stop_msg, replyMarkup = keyboard)]
def setEnabled(chat_id, status): bds.setEnabled(chat_id, status)