delete command message for /price
This commit is contained in:
parent
e6e2635ce9
commit
54fa3bcc4a
10
bot.py
10
bot.py
@ -259,6 +259,8 @@ class TelegramMonitorBot:
|
|||||||
if CMC_API_KEY is not None:
|
if CMC_API_KEY is not None:
|
||||||
self.available_commands.append('price')
|
self.available_commands.append('price')
|
||||||
|
|
||||||
|
print('Available commands: {}'.format(', '.join(self.available_commands)))
|
||||||
|
|
||||||
# Cached token prices
|
# Cached token prices
|
||||||
self.cached_prices = {}
|
self.cached_prices = {}
|
||||||
|
|
||||||
@ -557,6 +559,7 @@ class TelegramMonitorBot:
|
|||||||
"""
|
"""
|
||||||
chat_id = None
|
chat_id = None
|
||||||
command = None
|
command = None
|
||||||
|
message_id = update.effective_message.message_id
|
||||||
|
|
||||||
command = command_from_message(update.effective_message)
|
command = command_from_message(update.effective_message)
|
||||||
|
|
||||||
@ -595,8 +598,15 @@ class TelegramMonitorBot:
|
|||||||
monetary_format(pdata.volume),
|
monetary_format(pdata.volume),
|
||||||
update.effective_user.username,
|
update.effective_user.username,
|
||||||
)
|
)
|
||||||
|
|
||||||
bot.send_message(chat_id, message, parse_mode=telegram.ParseMode.MARKDOWN)
|
bot.send_message(chat_id, message, parse_mode=telegram.ParseMode.MARKDOWN)
|
||||||
|
|
||||||
|
# Delete the command message
|
||||||
|
try:
|
||||||
|
bot.delete_message(chat_id, message_id)
|
||||||
|
except Exception:
|
||||||
|
# nbd if we cannot delete it
|
||||||
|
pass
|
||||||
|
|
||||||
def error(self, bot, update, error):
|
def error(self, bot, update, error):
|
||||||
""" Log Errors caused by Updates. """
|
""" Log Errors caused by Updates. """
|
||||||
|
Loading…
Reference in New Issue
Block a user