package app import ( "context" "os" "github.com/mymmrac/telego" th "github.com/mymmrac/telego/telegohandler" "github.com/robfig/cron/v3" "code.destrealm.net/zancarius/justusbot/internal/settings" "go.destrealm.net/vfs" ) type app struct { chats vfs.MutableFS translations vfs.VFS root vfs.VFS verses vfs.VFS settings *settings.Settings cron *cron.Cron } func NewApp(conf string) (*app, error) { a := &app{} cwd, err := os.Getwd() if err != nil { return nil, err } if root, err := vfs.NewVFS(cwd); err == nil { if chats, err := root.Chroot("./data/chats"); err != nil { return nil, err } else { a.chats = chats.Mutable() } if a.translations, err = root.Chroot("./data/translations"); err == nil { a.translations.SetReadOnly(true) } else { return nil, err } if a.verses, err = root.Chroot("./data/verses"); err == nil { a.verses.SetReadOnly(true) } else { return nil, err } } else { return nil, err } if s, err := settings.LoadSettings(conf, a.root); err != nil { return nil, err } else { a.settings = s } return a, nil } func (a *app) Start() error { return nil } type chats struct { } type bot struct { settings *settings.Settings tgbot *telego.Bot handler *th.BotHandler ctx context.Context cancel context.CancelFunc chats *chats } func newBot() (*bot, error) { return nil, nil }