(_,m:Message)
| 63 | |
| 64 | @Client.on_message(filters.command("maintenance") & filters.private & filters.user(Config.ADMIN)) |
| 65 | async def maintenance_cmd(_,m:Message): |
| 66 | args=m.text.split(maxsplit=1) |
| 67 | if len(args)<2: |
| 68 | return await m.reply("Usage: /maintenance [on/off]") |
| 69 | status=args[1].lower() |
| 70 | if status=="on": |
| 71 | if await tb.get_maintenance(): |
| 72 | return await m.reply("⚠️ Maintenance mode is already enabled.") |
| 73 | await tb.set_maintenance(True) |
| 74 | return await m.reply("✅ Maintenance mode **enabled**.") |
| 75 | if status=="off": |
| 76 | if not await tb.get_maintenance(): |
| 77 | return await m.reply("⚠️ Maintenance mode is already disabled.") |
| 78 | await tb.set_maintenance(False) |
| 79 | return await m.reply("❌ Maintenance mode **disabled**.") |
| 80 | await m.reply("Invalid status. Use 'on' or 'off'.") |
nothing calls this directly
no test coverage detected