Added commands.
This commit is contained in:
parent
a4cdfdad06
commit
23897121d3
3 changed files with 49 additions and 0 deletions
|
|
@ -116,6 +116,26 @@ func main() {
|
|||
{
|
||||
Name: "verse",
|
||||
Description: "Bible verse helpers and tools.",
|
||||
Commands: []*cli.Command{
|
||||
{
|
||||
Name: "add",
|
||||
Description: "Add a verse to the random rotation.",
|
||||
Action: cmdHost.Verse().AddVerse,
|
||||
/*//Future implementation.
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "translation",
|
||||
Usage: "Specifies which translation this verse should be included from.",
|
||||
Aliases: []string{"t"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "date",
|
||||
Usage: "Specifies a date for the provided verse to be displayed. Overrides random rotation. Use with caution as this will override random verses for all connected chats.",
|
||||
Aliases: []string{"d"},
|
||||
},
|
||||
},*/
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import (
|
|||
type commands struct {
|
||||
root vfs.VFS
|
||||
meta *metadata
|
||||
verse *verse
|
||||
settings *settings.Settings
|
||||
}
|
||||
|
||||
|
|
@ -34,3 +35,7 @@ func (c *commands) Initalizer() *installer {
|
|||
func (c *commands) Meta() *metadata {
|
||||
return c.meta
|
||||
}
|
||||
|
||||
func (c *commands) Verse() *verse {
|
||||
return c.verse
|
||||
}
|
||||
|
|
|
|||
24
internal/commands/verse.go
Normal file
24
internal/commands/verse.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"code.destrealm.net/zancarius/justusbot/internal/settings"
|
||||
"github.com/urfave/cli/v3"
|
||||
"go.destrealm.net/vfs"
|
||||
)
|
||||
|
||||
type verse struct {
|
||||
fs vfs.VFS
|
||||
settings *settings.Settings
|
||||
}
|
||||
|
||||
func (m *verse) AddVerse(ctx context.Context, cmd *cli.Command) error {
|
||||
format := cmd.String("format")
|
||||
_ = format
|
||||
fmt.Println(cmd.Args())
|
||||
|
||||
fmt.Println("dump")
|
||||
return nil
|
||||
}
|
||||
Loading…
Reference in a new issue