mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-03 03:12:41 +02:00
post megre cleanup.
This commit is contained in:
parent
3e1def9041
commit
5b96fd5f5e
284 changed files with 7103 additions and 11307 deletions
23
server/internal/plugins/chat/config.go
Normal file
23
server/internal/plugins/chat/config.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package chat
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Enabled bool
|
||||
}
|
||||
|
||||
func (Config) Init(cmd *cobra.Command) error {
|
||||
cmd.PersistentFlags().Bool("chat.enabled", true, "whether to enable chat plugin")
|
||||
if err := viper.BindPFlag("chat.enabled", cmd.PersistentFlags().Lookup("chat.enabled")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Config) Set() {
|
||||
s.Enabled = viper.GetBool("chat.enabled")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue