INNER CODE UNIT · Python
start
IlyaGusev/rulm · self_instruct/src/bot/run.py:47
def start(self, update: Update, context: CallbackContext):
self.show(update, context)
def button(self, update: Update, context: CallbackContext) -> None:
query = update.callback_query
query.answer()
data = query.data
chat_id = update.effective_chat.id
if self.write_result(data, chat_id):
self.show(update, context)
else:
context.bot.send_message(text="Нужно перезапустить бот через '/start'", chat_id=chat_id)
def sample_record(self, username, retries=50, max_overlap=3):
for _ in range(retries):
record = random.choice(self.records)