mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-19 06:11:15 +00:00
chore: simplify telegram safety wrapper
This commit is contained in:
@@ -101,12 +101,9 @@ def authorized_only(command_handler: Callable[..., Coroutine[Any, Any, None]]):
|
|||||||
update = kwargs.get("update") or args[0]
|
update = kwargs.get("update") or args[0]
|
||||||
|
|
||||||
# Reject unauthorized messages
|
# Reject unauthorized messages
|
||||||
if update.callback_query:
|
message = update.message if update.callback_query is None else update.callback_query.message
|
||||||
cchat_id = int(update.callback_query.message.chat.id)
|
cchat_id = int(message.chat_id)
|
||||||
ctopic_id = update.callback_query.message.message_thread_id
|
ctopic_id = message.message_thread_id
|
||||||
else:
|
|
||||||
cchat_id = int(update.message.chat_id)
|
|
||||||
ctopic_id = update.message.message_thread_id
|
|
||||||
|
|
||||||
chat_id = int(self._config["telegram"]["chat_id"])
|
chat_id = int(self._config["telegram"]["chat_id"])
|
||||||
if cchat_id != chat_id:
|
if cchat_id != chat_id:
|
||||||
|
|||||||
Reference in New Issue
Block a user