Починил /settings
Метод _settings перекрывался атрибутом Settings. Переименовал обработчик в _settings_command.
This commit is contained in:
parent
6338a47333
commit
37a954c9fc
6
bot.py
6
bot.py
|
|
@ -139,7 +139,9 @@ class MpakoBot:
|
|||
application.add_handler(CommandHandler("status", self._status))
|
||||
application.add_handler(CommandHandler("balance", self._balance))
|
||||
application.add_handler(CommandHandler("invite", self._invite))
|
||||
application.add_handler(CommandHandler("settings", self._settings))
|
||||
application.add_handler(
|
||||
CommandHandler("settings", self._settings_command)
|
||||
)
|
||||
application.add_handler(CommandHandler("restart", self._reset))
|
||||
application.add_handler(CommandHandler("reset", self._reset))
|
||||
application.add_handler(
|
||||
|
|
@ -553,7 +555,7 @@ class MpakoBot:
|
|||
]
|
||||
)
|
||||
|
||||
async def _settings(
|
||||
async def _settings_command(
|
||||
self, update: Update, context: ContextTypes.DEFAULT_TYPE
|
||||
) -> None:
|
||||
if not await self._check_access(update):
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from bot import MpakoBot
|
||||
from config import Settings
|
||||
|
||||
|
||||
def test_settings_command_is_not_shadowed_by_settings_attribute() -> None:
|
||||
bot = MpakoBot(Settings(bot_token=""))
|
||||
assert callable(bot._settings_command)
|
||||
|
||||
|
||||
def test_quality_keyboard_marks_standard() -> None:
|
||||
|
|
|
|||
Loading…
Reference in New Issue