Skip to content
This repository has been archived by the owner on Mar 18, 2020. It is now read-only.

Commit

Permalink
add access token flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Cooper committed Mar 21, 2015
1 parent 9371b3a commit aefa379
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
piepan v0.7.0
usage: piepan [options] [script files]
an easy to use framework for writing scriptable Mumble bots
-access-token=[]: server access token (can be defined multiple times)
-certificate="": user certificate file (PEM)
-ffmpeg="ffmpeg": ffmpeg-capable executable for media streaming
-insecure=false: skip certificate checking
Expand Down Expand Up @@ -96,6 +97,7 @@

- Next
- Add additional Lua support via [gopher-lua](https://github.com/yuin/gopher-lua)
- Add access token flag
- Non-script-invoked disconnections are reported though the exit status
- Remove `-servername` flag (`-lock` + `-insecure` should be used instead)
- JavaScript plugin: `piepan.Users` and `piepan.Channels` are no longer mapped using string keys ([otto](https://github.com/robertkrimen/otto) needs to be updated before building)
Expand Down
14 changes: 14 additions & 0 deletions cmd/piepan/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ import (
"github.com/layeh/piepan"
)

type strFlagSlice []string

func (s *strFlagSlice) Set(str string) error {
*s = append(*s, str)
return nil
}

func (s *strFlagSlice) String() string {
return fmt.Sprintf("%v", *s)
}

func main() {
// Flags
username := flag.String("username", "piepan-bot", "username of the bot")
Expand All @@ -22,6 +33,8 @@ func main() {
insecure := flag.Bool("insecure", false, "skip certificate checking")
lock := flag.String("lock", "", "server certificate lock file")
ffmpeg := flag.String("ffmpeg", "ffmpeg", "ffmpeg-capable executable for media streaming")
var accessTokens strFlagSlice
flag.Var(&accessTokens, "access-token", "server access token (can be defined multiple times)")

flag.Usage = func() {
fmt.Fprintf(os.Stderr, "piepan v0.7.0\n")
Expand All @@ -47,6 +60,7 @@ func main() {
Username: *username,
Password: *password,
Address: *server,
Tokens: gumble.AccessTokens(accessTokens),
}

client := gumble.NewClient(&config)
Expand Down

0 comments on commit aefa379

Please sign in to comment.