Skip to content

Commit

Permalink
Fix not working reply (main feature) and add main menu button to new …
Browse files Browse the repository at this point in the history
…message
  • Loading branch information
p-hash committed Sep 11, 2016
1 parent 16d3478 commit e9afb1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,14 @@ def startmsg(self):

@property
def replying_to(self):
if time() - self._last_seen > self._replying_to_expiration: # if admin wasn't here for a quite long time
if time() - self._replying_to_update > self._replying_to_expiration: # if admin wasn't here for a quite long time
self._replying_to = None # ignore last replying_to
return self._replying_to

@replying_to.setter
def replying_to(self, value):
self._replying_to = value
self._replying_to_update = time()

def update_last_seen(self):
self._last_seen = time()
Expand Down
1 change: 1 addition & 0 deletions proxy_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ def handle_all(message):
types.InlineKeyboardButton(strings.btn.block, callback_data='user_block_{}'.format(user.id)),
types.InlineKeyboardButton(strings.btn.reply, callback_data='reply_{}'.format(user.id))
)
markup.add(types.InlineKeyboardButton(strings.btn.menu, callback_data='menu'))
bot.send_message( # send it to admin
my_id,
text,
Expand Down

0 comments on commit e9afb1a

Please sign in to comment.