Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ services:
build: .
container_name: condor-bot
restart: unless-stopped
environment:
TELEGRAM_TOKEN: your_bot_token
AUTHORIZED_USERS: chat_id_1,chat_id_2
env_file:
- .env
volumes:
# Persist bot data (user preferences, trading context, etc.)
- ./data:/app/data
- ./condor_bot_data.pickle:/app/condor_bot_data.pickle
# Mount servers config
- ./servers.yml:/app/servers.yml
environment:
- PYTHONUNBUFFERED=1
# Optional: enable if you need to access the host network (e.g., for local Hummingbot instances)
# network_mode: host
network_mode: host
11 changes: 11 additions & 0 deletions handlers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,14 @@ def clear_all_input_states(context: ContextTypes.DEFAULT_TYPE) -> None:
context.user_data.pop("editing_controller_field", None)
context.user_data.pop("deploy_params", None)
context.user_data.pop("editing_deploy_field", None)

# Bots - archived states
context.user_data.pop("archived_databases", None)
context.user_data.pop("archived_current_db", None)
context.user_data.pop("archived_page", None)
context.user_data.pop("archived_summaries", None)
context.user_data.pop("archived_total_count", None)

# Routines states
context.user_data.pop("routines_state", None)
context.user_data.pop("routines_editing", None)
41 changes: 41 additions & 0 deletions handlers/bots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@
)
from ._shared import clear_bots_state, SIDE_LONG, SIDE_SHORT

# Archived bots handlers
from .archived import (
show_archived_menu,
show_archived_detail,
show_timeline_chart,
show_bot_chart,
handle_generate_report,
handle_archived_refresh,
clear_archived_state,
)

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -625,6 +636,36 @@ async def bots_callback_handler(update: Update, context: ContextTypes.DEFAULT_TY
idx = int(action_parts[1])
await handle_refresh_controller(update, context, idx)

# Archived bots handlers
elif main_action == "archived":
await show_archived_menu(update, context)

elif main_action == "archived_page":
if len(action_parts) > 1:
page = int(action_parts[1])
await show_archived_menu(update, context, page)

elif main_action == "archived_select":
if len(action_parts) > 1:
db_index = int(action_parts[1])
await show_archived_detail(update, context, db_index)

elif main_action == "archived_timeline":
await show_timeline_chart(update, context)

elif main_action == "archived_chart":
if len(action_parts) > 1:
db_index = int(action_parts[1])
await show_bot_chart(update, context, db_index)

elif main_action == "archived_report":
if len(action_parts) > 1:
db_index = int(action_parts[1])
await handle_generate_report(update, context, db_index)

elif main_action == "archived_refresh":
await handle_archived_refresh(update, context)

else:
logger.warning(f"Unknown bots action: {action}")
await query.message.reply_text(f"Unknown action: {action}")
Expand Down
5 changes: 5 additions & 0 deletions handlers/bots/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ def clear_bots_state(context) -> None:
context.user_data.pop("editing_controller_field", None)
context.user_data.pop("deploy_params", None)
context.user_data.pop("editing_deploy_field", None)
# Archived bots state
context.user_data.pop("archived_databases", None)
context.user_data.pop("archived_current_db", None)
context.user_data.pop("archived_page", None)
context.user_data.pop("archived_summaries", None)


def get_controller_config(context) -> Dict[str, Any]:
Expand Down
Loading