diff --git a/bot/commands/journal.py b/bot/commands/journal.py index 6ef06f3..242b7f0 100644 --- a/bot/commands/journal.py +++ b/bot/commands/journal.py @@ -67,8 +67,9 @@ class JournalHandler(BaseHandler): date = date ) if new: + count = self.models.JournalEntry.select().count() await query.edit_message_text( - text=f"What is your entry for {self.current_model.date_pretty}?" + text=f"Journal entry no. {count}. What happened on {self.current_model.date_pretty}?" ) else: await query.edit_message_text(text="An entry already exists for this date") @@ -113,7 +114,10 @@ class JournalHandler(BaseHandler): await update.message.reply_text("An entry already exists for this date") return ConversationHandler.END else: - await update.message.reply_text(f"What is your entry for {self.current_model.date_pretty}?") + count = self.models.JournalEntry.select().count() + await update.message.reply_text( + text=f"Journal entry no. {count}. What happened on {self.current_model.date_pretty}?" + ) return ADD_CONTENT diff --git a/bot/commands/memory.py b/bot/commands/memory.py index 17cf3b4..cd25b65 100644 --- a/bot/commands/memory.py +++ b/bot/commands/memory.py @@ -1,4 +1,4 @@ -import datetime +import os from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, filters, CallbackQueryHandler, CallbackContext from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update, InputMediaPhoto # ACTION_CHOICE, DATE_ENTRY, ADD_CONTENT = range(3) @@ -27,6 +27,9 @@ class MemoryHandler(BaseHandler): async def entry_point(self, update: Update, context: CallbackContext): await super().entry_point(update, context) + if os.getenv("DOCKERIZED", "false") == "true" and os.getenv("CHAT_ID") != str(update.message.chat_id): + await update.message.reply_text("You are not authorized to use this bot") + return ConversationHandler.END search_string = " ".join(context.args)