mirror of
https://github.com/maubot/maubot
synced 2025-08-29 20:10:39 +00:00
Add unfinished command handler system based on the improved bot support proposal
This commit is contained in:
parent
946dac989a
commit
307a32e0c0
9 changed files with 355 additions and 16 deletions
|
@ -1,4 +1,4 @@
|
|||
// jesaribot - A simple maubot plugin.
|
||||
// maubot - A plugin-based Matrix bot system written in Go.
|
||||
// Copyright (C) 2018 Tulir Asokan
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
|
@ -22,12 +22,17 @@ import (
|
|||
log "maunium.net/go/maulogger"
|
||||
)
|
||||
|
||||
type Scannable interface {
|
||||
Scan(...interface{}) error
|
||||
}
|
||||
|
||||
type Database struct {
|
||||
Type string `yaml:"type"`
|
||||
Name string `yaml:"name"`
|
||||
|
||||
MatrixClient *MatrixClientStatic `yaml:"-"`
|
||||
Plugin *PluginStatic `yaml:"-"`
|
||||
CommandSpec *CommandSpecStatic `yaml:"-"`
|
||||
|
||||
sql *sql.DB
|
||||
}
|
||||
|
@ -40,6 +45,7 @@ func (db *Database) Connect() (err error) {
|
|||
|
||||
db.MatrixClient = &MatrixClientStatic{db: db, sql: db.sql}
|
||||
db.Plugin = &PluginStatic{db: db, sql: db.sql}
|
||||
db.CommandSpec = &CommandSpecStatic{db: db, sql: db.sql}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue