--- a/discord/commands.go Sun Apr 07 01:33:21 2019 -0500
+++ b/discord/commands.go Sun Apr 07 02:05:16 2019 -0500
@@ -29,9 +29,16 @@
+ if !strings.HasPrefix(m.Content, c.mentionString) { + log.Debugf("message contents: '%s'", m.Content) + log.Debugf("our user id: %s", c.userID) parts := strings.Split(m.Content, " ")
- command := strings.ToLower(parts[0])
+ command := strings.ToLower(parts[1]) if handler, found := commands[command]; found {
@@ -60,16 +67,18 @@
func isLiveCommand(c *DiscordClient, m *discordgo.MessageCreate) error {
args := strings.Split(m.Content, " ")
return fmt.Errorf("invalid arguments")
- if len(m.Mentions) > 0 {
+ if len(m.Mentions) > 1 { + log.Debugf("getting presence on %s for %s", m.GuildID, member.ID) p := c.getPresence(m.GuildID, member.ID)
+ log.Debugf("presences: %#v", p) return fmt.Errorf("no presence data found")
--- a/discord/discord.go Sun Apr 07 01:33:21 2019 -0500
+++ b/discord/discord.go Sun Apr 07 02:05:16 2019 -0500
@@ -15,6 +15,9 @@
client *discordgo.Session
func New(token string, db database.Database) (*DiscordClient, error) {
@@ -41,6 +44,9 @@
+ c.userID = c.client.State.Ready.User.ID + c.mentionString = "<@" + c.userID + "> " func (c *DiscordClient) Shutdown() error {