From 57402ac47735ba291bbec96ca1a8a5f3e065da92 Mon Sep 17 00:00:00 2001 From: Sean Hinchee Date: Wed, 16 Jan 2019 18:31:29 -0600 Subject: [PATCH] change :u to :n ;; misc cleanups ;; improve readme with accurate information --- README.md | 5 +++-- commands.go | 23 ++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e5008e8af964dc0c62ff29d95721559946db3a77..13f135f2a367a5abf8671a1ca457a017369db7e5 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,12 @@ Commands available in chat: | Command | Function | | ------------- |-------------| | :q | Quits disco | -| :g | Change listening Guild| -| :c [n|?] | Change listening Channel inside Guild, or list channels | +| :g | Change listening Guild | +| :c [n ?] | Change listening Channel inside Guild, or list channels | | :m [n] | Display last [n] messages: ex. `:m 2` displays last two messages | | :p | Pulls up the private channel menu | | :n name | Change nickname to `name` | +| :? | List the available commands | You can regex the last message sent using a format such as: diff --git a/commands.go b/commands.go index 037fd3683f8537bc6d2f0ee61244be1160867f5b..ec0fe6e4c8a744f03cdcafdfd1db42fbb3ecfe59 100644 --- a/commands.go +++ b/commands.go @@ -50,14 +50,15 @@ func ParseForCommands(line string) string { return line case ":?": // Show help menu - Msg(TextMsg, "Commands: ") - Msg(TextMsg, "[:g] - Select guild") - Msg(TextMsg, "[:p] - Select private message") - Msg(TextMsg, "[:c] - Select guild channel") - Msg(TextMsg, "[:c ?] - List guild channels") - Msg(TextMsg, "[:c ] - Go directly to channel") - Msg(TextMsg, "[:m ] - Display last messages") - Msg(TextMsg, "[:u ] - Change username") + Msg(TextMsg, "Commands: \n") + Msg(TextMsg, "[:g] - Open guild menu\n") + Msg(TextMsg, "[:p] - Open private message menu\n") + Msg(TextMsg, "[:c] - Open guild channel menu\n") + Msg(TextMsg, "[:c ?] - List guild channels\n") + Msg(TextMsg, "[:c ] - Go directly to channel \n") + Msg(TextMsg, "[:m ] - Display last messages\n") + Msg(TextMsg, "[:n ] - Change username to \n") + return "" case ":g": SelectGuild() return "" @@ -117,13 +118,13 @@ func ParseForCommands(line string) string { State.RetrieveMessages(Amount) PrintMessages(Amount) return "" - case ":u": + case ":n": session := State.Session user := session.User - newName := strings.TrimPrefix(line, ":u ") + newName := strings.TrimPrefix(line, ":n ") _, err := State.Session.DiscordGo.UserUpdate(user.Email, session.Password, newName, user.Avatar, "") if err != nil { - Msg(ErrorMsg, "[:u] Argument Error: %s\n", err) + Msg(ErrorMsg, "[:n] Argument Error: %s\n", err) return "" } Msg(TextMsg, "name -> %s\n", newName)