Add channel ID as argument

Also, go mod stuff
This commit is contained in:
Brian Buller 2018-11-05 06:12:30 -06:00
parent 79c6427fc8
commit be18316c16
3 changed files with 19 additions and 5 deletions

View File

@ -22,8 +22,8 @@ var boardID string
var slackChannel string var slackChannel string
func main() { func main() {
if len(os.Args) != 3 { if len(os.Args) != 4 {
fmt.Fprintf(os.Stderr, "usage: "+programName+" <slack-bot-token> <aoc-leaderboard-number>\n") fmt.Fprintf(os.Stderr, "usage: "+programName+" <slack-bot-token> <slack-channel-id> <aoc-leaderboard-number>\n")
os.Exit(1) os.Exit(1)
} }
@ -33,14 +33,15 @@ func main() {
if db, err = getDatabase(); err != nil { if db, err = getDatabase(); err != nil {
panic(err) panic(err)
} }
// AoC Channel
slackChannel = "C0G3X1M5K"
// AoC Channel
//slackChannel = "C0G3X1M5K"
// br0xen DM // br0xen DM
//slackChannel = "D0D793N5R" //slackChannel = "D0D793N5R"
slackChannel = os.Args[2]
// DevICT Leaderboard: 3549 // DevICT Leaderboard: 3549
boardID = os.Args[2] boardID = os.Args[3]
if slack, err = CreateSlack(os.Args[1]); err != nil { if slack, err = CreateSlack(os.Args[1]); err != nil {
panic(err) panic(err)

7
go.mod Normal file
View File

@ -0,0 +1,7 @@
module git.bullercodeworks.com/brian/aocbot
require (
github.com/boltdb/bolt v1.3.1 // indirect
github.com/br0xen/boltease v0.0.0-20170907120147-8d9019e01b5d
golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc
)

6
go.sum Normal file
View File

@ -0,0 +1,6 @@
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/br0xen/boltease v0.0.0-20170907120147-8d9019e01b5d h1:Cafc/GJznwpKU27qTIKHISXILZtxKbpjTpDtu4Uld68=
github.com/br0xen/boltease v0.0.0-20170907120147-8d9019e01b5d/go.mod h1:RYd35ZKShXLVjH6cqh+IFrF9HorOg6H1MpQg5XrGjmA=
golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc h1:ZMCWScCvS2fUVFw8LOpxyUUW5qiviqr4Dg5NdjLeiLU=
golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=