small privacy improvements
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Remy Moll 2023-08-14 11:36:39 +02:00
parent 2afde219a9
commit 3975ca5997
2 changed files with 10 additions and 3 deletions

View File

@ -67,8 +67,9 @@ class JournalHandler(BaseHandler):
date = date date = date
) )
if new: if new:
count = self.models.JournalEntry.select().count()
await query.edit_message_text( 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: else:
await query.edit_message_text(text="An entry already exists for this date") 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") await update.message.reply_text("An entry already exists for this date")
return ConversationHandler.END return ConversationHandler.END
else: 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 return ADD_CONTENT

View File

@ -1,4 +1,4 @@
import datetime import os
from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, filters, CallbackQueryHandler, CallbackContext from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, filters, CallbackQueryHandler, CallbackContext
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update, InputMediaPhoto from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update, InputMediaPhoto
# ACTION_CHOICE, DATE_ENTRY, ADD_CONTENT = range(3) # ACTION_CHOICE, DATE_ENTRY, ADD_CONTENT = range(3)
@ -27,6 +27,9 @@ class MemoryHandler(BaseHandler):
async def entry_point(self, update: Update, context: CallbackContext): async def entry_point(self, update: Update, context: CallbackContext):
await super().entry_point(update, context) 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) search_string = " ".join(context.args)