Skip to content

Commit

Permalink
Do not spam user with debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
sio committed Jul 6, 2022
1 parent 2348dfc commit 633bb8d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/microblog/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def allowed(self, update):

async def microblog(self, update, context):
'''Save microblog message to storage'''
response = []
user = update.effective_user
message = update.effective_message
entry = MicroblogEntry(
Expand All @@ -77,9 +76,9 @@ async def microblog(self, update, context):
and 0 <= delay.total_seconds() <= max_delay \
and entry.author == prev.author:
entry = prev
response.append('Attached photos to previous microblog entry')
log.debug('Attaching photos to previous microblog entry')
uid = self.storage.save(entry)
response.append(f'Saved microblog entry: {uid}')
log.debug(f'Saved microblog entry: {uid}')

photos_seen = set()
for photo in sorted(message.photo, key=lambda x: x.width, reverse=True):
Expand All @@ -94,7 +93,7 @@ async def microblog(self, update, context):
await remote.download(out=local)
log.debug(f'Downloaded photo: {name}')

await message.reply_text('\n'.join(response))
await message.reply_text('Ok')

async def hello(self, update, context):
if not self.allowed(update):
Expand Down

0 comments on commit 633bb8d

Please sign in to comment.