INNER CODE UNIT · Python

run

IlyaGusev/rulm · self_instruct/src/bot/run.py:43

    def run(self):
        self.updater.start_polling()
        self.updater.idle()

    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)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…