manage users in runtime, closes #16

This commit is contained in:
Aine
2022-08-29 21:41:14 +03:00
parent 0ba951fbe6
commit f97ebb604a
7 changed files with 119 additions and 18 deletions

View File

@@ -14,6 +14,7 @@ import (
const (
commandHelp = "help"
commandStop = "stop"
commandUsers = botOptionUsers
commandDelete = "delete"
commandMailboxes = "mailboxes"
)
@@ -111,6 +112,11 @@ func (b *Bot) buildCommandList() commandList {
allowed: b.allowOwner,
},
{allowed: b.allowAdmin}, // delimiter
{
key: botOptionUsers,
description: "Get or set allowed users",
allowed: b.allowAdmin,
},
{
key: commandMailboxes,
description: "Show the list of all mailboxes",
@@ -140,6 +146,8 @@ func (b *Bot) handleCommand(ctx context.Context, evt *event.Event, commandSlice
b.sendHelp(ctx)
case commandStop:
b.runStop(ctx)
case commandUsers:
b.runUsers(ctx, commandSlice)
case commandDelete:
b.runDelete(ctx, commandSlice)
case commandMailboxes: