From 05c7953a3bb9c5b2a21cfc8f3cf24f54224b7644 Mon Sep 17 00:00:00 2001 From: Sean Hinchee Date: Mon, 24 Jul 2017 23:40:54 -0500 Subject: [PATCH] Cleaning up v1.0 --- README.md | 4 ++++ main.go | 7 ++++--- menu.go | 16 +++++++++++----- mkfile | 11 +++++++++++ 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b5d6dfefdfabc092392b67f6856faf79fe675977..69d8277d6ec6e28851e703c04cd9897f4a4a2411 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,7 @@ Commands available in chat: | :c | Change listening Channel inside Guild | | :m [n] | Display last [n] messages: ex. `:m 2` displays last two messages | | :p | Pulls up the private channel menu | + +## Notes + +If you can connect to a channel and see messages, but yours aren't sending, check to make sure your e-mail address is verified. diff --git a/main.go b/main.go index e33df7595d8327dd05d0e4cd5e29ad0751a077d2..749f6740f4f78ce90ca2c8904c7e59cca43f6a48 100644 --- a/main.go +++ b/main.go @@ -38,7 +38,7 @@ func main() { GetConfig() CheckState() Clear() - Msg(HeaderMsg, "disco ­ version: %s\n\n", Version) + Msg(HeaderMsg, "disco version: %s\n\n", Version) //NewSession Session = DiscordState.NewSession(Config.Username, Config.Password) //Please don't abuse @@ -75,9 +75,10 @@ func main() { line = ParseForCommands(line) line = ParseForMentions(line) - + if line != "" { - State.Session.DiscordGo.ChannelMessageSend(State.Channel.ID, line) + /*_ ,err :=*/ State.Session.DiscordGo.ChannelMessageSend(State.Channel.ID, line) + //fmt.Print("Error: ", err, "\n") } } diff --git a/menu.go b/menu.go index 820cd0a75f68527d93022da250e41a5567f15cf4..f38bd6e67fc82d765e37e9c6c2c3fa94bdba0dcf 100644 --- a/menu.go +++ b/menu.go @@ -4,6 +4,8 @@ import ( "fmt" "log" "strconv" + "bufio" + "os" ) //SelectPrivateMenu is a menu item that changes to a private channel @@ -217,7 +219,7 @@ Start: Msg(InfoMsg, "Extra Options:\n") Msg(TextMsg, "[n] Join New Server\n") Msg(TextMsg, "[d] Leave Server\n") - Msg(TextMsg, "[o] Join Official discord-cli Server\n") + Msg(TextMsg, "[o] Join Official 9fans Server\n") Msg(TextMsg, "[b] Go Back\n") var response string @@ -237,7 +239,11 @@ Start: goto New } Msg(TextMsg, "Join %s ? [y/n]:\n", Invite.Guild.Name) - fmt.Scanf("%s\n", &response) + reader := bufio.NewReader(os.Stdin) + response, _ := reader.ReadString('\n') + response = response[:len(response)-1] + + //fmt.Scanf("%s\n", &response) if response == "y" { Session.DiscordGo.InviteAccept(Invite.Code) err := Session.Update() @@ -248,12 +254,12 @@ Start: goto Start } case "o": - _, err := Session.DiscordGo.InviteAccept("0pXWCo5RQbVuFHDM") + _, err := Session.DiscordGo.InviteAccept("https://discord.gg/6daut5T") if err != nil { - Msg(ErrorMsg, "Joining Official discord-cli Server failed\n") + Msg(ErrorMsg, "Joining Official 9fans Server failed\n") goto Start } - Msg(InfoMsg, "Joined Official discord-cli Server!\n") + Msg(InfoMsg, "Joined Official 9fans Server!\n") case "d": LeaveServerMenu() goto Start diff --git a/mkfile b/mkfile index 8362b83e330fba808fffbab3999784e4be1e829b..c65139c67e801f3c75abdcd5743244d4aa4d153a 100644 --- a/mkfile +++ b/mkfile @@ -18,3 +18,14 @@ crypto: hget https://github.com/golang/crypto/archive/master.zip > crypto.zip; unzip -f crypto.zip dircp crypto-master crypto; rm -r crypto-master cd $orig + +rebuild: + go install bitbucket.org/henesy/disco + mk install + +bins: + arch=(amd64 386 arm) + for(a in $arch){ + GOARCH=$a go build + cp disco bin/^$a^/ + }