move verify command to room subcommand
This commit is contained in:
+7
-9
@@ -1828,7 +1828,7 @@ class CommunityBot(Plugin):
|
|||||||
async def room(self, evt: MessageEvent) -> None:
|
async def room(self, evt: MessageEvent) -> None:
|
||||||
"""Main room command - shows usage by default"""
|
"""Main room command - shows usage by default"""
|
||||||
await evt.reply(
|
await evt.reply(
|
||||||
"Use !community room <subcommand> to manage rooms. Available subcommands: create, archive, replace, guests, id, version, setpower"
|
"Use !community room <subcommand> to manage rooms. Available subcommands: create, archive, replace, guests, id, version, setpower, enable-verification"
|
||||||
)
|
)
|
||||||
|
|
||||||
@room.subcommand(
|
@room.subcommand(
|
||||||
@@ -2764,17 +2764,15 @@ class CommunityBot(Plugin):
|
|||||||
self.log.error(error_msg)
|
self.log.error(error_msg)
|
||||||
await evt.respond(error_msg, edits=msg)
|
await evt.respond(error_msg, edits=msg)
|
||||||
|
|
||||||
@community.subcommand(
|
@room.subcommand(
|
||||||
"verify-migrate",
|
"enable-verification",
|
||||||
help="migrate a room to a verification-based permission model, ensuring current members can still send messages while new joiners require verification",
|
help="migrate a room to a verification-based permission model, ensuring current members can still send messages while new joiners require verification",
|
||||||
)
|
)
|
||||||
async def verify_migrate(self, evt: MessageEvent) -> None:
|
@decorators.require_parent_room
|
||||||
if not await self.check_parent_room(evt):
|
@decorators.require_permission()
|
||||||
return
|
async def room_enable_verification(self, evt: MessageEvent) -> None:
|
||||||
|
"""Enable verification-based permissions for the current room"""
|
||||||
await evt.mark_read()
|
await evt.mark_read()
|
||||||
if not await self.user_permitted(evt.sender):
|
|
||||||
await evt.reply("You don't have permission to use this command")
|
|
||||||
return
|
|
||||||
|
|
||||||
msg = await evt.respond("Starting room migration...")
|
msg = await evt.respond("Starting room migration...")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user