MCPcopy Create free account
hub / github.com/TechifyBots/Rename-Bot / maintenance_cmd

Function maintenance_cmd

plugins/maintenance.py:65–80  ·  view source on GitHub ↗
(_,m:Message)

Source from the content-addressed store, hash-verified

63
64@Client.on_message(filters.command("maintenance") & filters.private & filters.user(Config.ADMIN))
65async 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'.")

Callers

nothing calls this directly

Calls 2

get_maintenanceMethod · 0.80
set_maintenanceMethod · 0.80

Tested by

no test coverage detected