Skip to content

Commit

Permalink
feat: update pybotx
Browse files Browse the repository at this point in the history
  • Loading branch information
kutuzov13 committed Dec 28, 2024
1 parent a907f45 commit 81b930b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 111 deletions.
6 changes: 5 additions & 1 deletion app/bot/commands/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ async def add_credentials_handler(message: IncomingMessage, bot: Bot) -> None:

# Normally bot accounts doesn't added on the fly
bot._bot_accounts_storage._bot_accounts.append( # noqa: WPS437
BotAccountWithSecret(id=bot_id, host=host, secret_key=secret_key)
BotAccountWithSecret(
id=bot_id,
cts_host=host,
secret_key=secret_key,
)
)

await bot.answer_message("Credentials was added")
6 changes: 5 additions & 1 deletion app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def _build_credentials_from_string(
host, secret_key, bot_id = [
str_value.strip() for str_value in credentials_str.split("@")
]
return BotAccountWithSecret(host=host, secret_key=secret_key, id=UUID(bot_id))
return BotAccountWithSecret(
cts_url=host,
secret_key=secret_key,
id=UUID(bot_id),
)


settings = AppSettings()
Loading

0 comments on commit 81b930b

Please sign in to comment.