Add POSTMOOGLE_ADMINS

This commit is contained in:
Slavi Pantaleev
2022-08-29 09:10:31 +03:00
parent 77a7e9efc6
commit a62dc0df4f
5 changed files with 47 additions and 19 deletions

View File

@@ -21,6 +21,7 @@ type Bot struct {
prefix string
domain string
allowedUsers []*regexp.Regexp
allowedAdmins []*regexp.Regexp
rooms sync.Map
log *logger.Logger
lp *linkpearl.Linkpearl
@@ -29,17 +30,25 @@ type Bot struct {
}
// New creates a new matrix bot
func New(lp *linkpearl.Linkpearl, log *logger.Logger, prefix, domain string, noowner, federation bool, allowedUsers []*regexp.Regexp) *Bot {
func New(
lp *linkpearl.Linkpearl,
log *logger.Logger,
prefix, domain string,
noowner, federation bool,
allowedUsers []*regexp.Regexp,
allowedAdmins []*regexp.Regexp,
) *Bot {
return &Bot{
noowner: noowner,
federation: federation,
prefix: prefix,
domain: domain,
allowedUsers: allowedUsers,
rooms: sync.Map{},
log: log,
lp: lp,
mu: map[id.RoomID]*sync.Mutex{},
noowner: noowner,
federation: federation,
prefix: prefix,
domain: domain,
allowedUsers: allowedUsers,
allowedAdmins: allowedAdmins,
rooms: sync.Map{},
log: log,
lp: lp,
mu: map[id.RoomID]*sync.Mutex{},
}
}