https://github.com/crosbymichael/botbot
Discord bot package inspired by urfave/cli
https://github.com/crosbymichael/botbot
Last synced: 3 months ago
JSON representation
Discord bot package inspired by urfave/cli
- Host: GitHub
- URL: https://github.com/crosbymichael/botbot
- Owner: crosbymichael
- License: mit
- Created: 2018-08-29T12:18:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-29T12:18:56.000Z (over 6 years ago)
- Last Synced: 2024-12-30T01:19:48.671Z (5 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# botbot
A package inspired by urfave/cli for writting discord bots in the same manner as you write CLI applicaitons.
## Example
```go
bot, err := botbot.New("test", clix.GlobalString("token"))
if err != nil {
return err
}
bot.Commands = []*botbot.Command{
timeCommand,
}
if err := bot.Start(); err != nil {
return err
}
<-s
return bot.Close()
``````go
var timeCommand = &botbot.Command{
Name: "time",
Description: "returns the current time",
Action: func(ctx *botbot.Context) error {
now := time.Now()
return ctx.Send(now.Format(time.RFC3339))
},
}
```