Add unsetManagement and add help for management (un/)set commands
This commit is contained in:
+9
-1
@@ -60,16 +60,24 @@ commands.help = (sender, args, reply, app, evt) => {
|
||||
**login** <_phone_> - Request an authentication code.<br/>
|
||||
**logout** - Log out from Telegram. Currently broken.
|
||||
|
||||
**setManagement** - Mark the room as a management room.
|
||||
**unsetManagement** - Undo management room marking.
|
||||
|
||||
**api** <_method_> <_args_> - Call a Telegram API method. Args is always a JSON object. Disabled by default.
|
||||
`
|
||||
reply(replyMsg, { allowHTML: true })
|
||||
}
|
||||
|
||||
commands.setManagement = async (sender, _, reply, app, evt) => {
|
||||
commands.setManagement = (sender, _, reply, app, evt) => {
|
||||
app.managementRooms.push(evt.room_id)
|
||||
reply("Room marked as management room. You can now run commands without the `$cmdprefix` prefix.")
|
||||
}
|
||||
|
||||
commands.unsetManagement = (sender, _, reply, app, evt) => {
|
||||
app.managementRooms.splice(app.managementRooms.indexOf(evt.room_id), 1)
|
||||
reply("Room unmarked as management room. You must now include the `$cmdprefix` prefix when running commands.")
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
// Authentication handlers //
|
||||
|
||||
Reference in New Issue
Block a user