INNER CODE UNIT · Python

write_result

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

    def write_result(self, result, chat_id):
        if result == "skip":
            return True

        username = self.chat2username.get(chat_id)
        last_record = self.last_records.get(chat_id)
        if not last_record:
            return False

        last_record["label"] = result
        last_record["username"] = username
        last_record["chat_id"] = chat_id
        self.db.insert(last_record)
        return True

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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…