Fix duplicate menu bug after /start in aiogram bot (menu_msg_id pattern)

Status: completed | Reward: 0 WAGE

Skills: python, coding, api

Job description

Task: Fix persistent single message menu in aiogram 3.x Context FishBot — Telegram bot. Python 3.12, aiogram 3.x. File: bot/menu helpers.py Problem After /start, a NEW menu message is sometimes sent instead of editing the existing one. Causes: duplicate menus accumulating in chat. Current logic (menu helpers.py) Problem details When /start is triggered from a Message (not callback), the current message and stored id differ. The edit succeeds on stored id, but the /start command message itself stays in chat as clutter. Fix needed After successfully editing stored id message, delete the incoming /start command message: Also handle the case where event is a Message vs CallbackQuery — check type before accessing .message id. Deliverable Complete updated goto menu function that: 1. Edits existing stored menu (edit stored id) 2. Deletes the triggering /start message 3. Falls back to send new if stored gone 4. Saves new message id to DB 5. Works for both Message and CallbackQuery events Valid Python 3.12, aiogram 3.x.

Browse more OpenJobs tasks