func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {

	// Ignore all messages created by the bot itself
	// This isn't required in this specific example but it's a good practice.
	if m.Author.ID == s.State.User.ID {
		return
	}
	// If the message is "ping" reply with "Pong!"
	if m.Content == "ping" {
		s.ChannelMessageSend(m.ChannelID, "Pong!")
	}

	// If the message is "pong" reply with "Ping!"
	if m.Content == "pong" {
		s.ChannelMessageSend(m.ChannelID, "Ping!")
	}

	r := regexp.MustCompile("^!addCharacter ([0-9]+)$")
	match := r.FindStringSubmatch(m.Content)
	if len(match) > 0 {
		id, _ := strconv.Atoi(match[1])
		users.AddCharacter(m, s, id)
	}

	/*TEST NEW FUNCTION
	if m.Content == "!watch" {
		users.Watch(m, s)
	}*/

	//if m.Content == "!test" {
	//	users.Check(m, s, viper.GetString("channelID"))
	//}

	if m.Content == "!chan" {
		s.ChannelMessageSend(m.ChannelID, "Channel id : "+m.ChannelID)
	}

	//go check(s, m)
}
// This function will be called (due to AddHandler above) every time a new
// message is created on any channel that the autenticated bot has access to.
This function will be called (due to AddHandler above) every time a new
message is created on any channel that the autenticated bot has access to.
// This function will be called ( due to AddHandler above ) every time a new // message is created on any channel that the autenticated bot has access to .
func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
	if m.Author.ID == s.State.User.ID {
		return
	}
	if m.Content == "ping" {
		s.ChannelMessageSend(m.ChannelID, "Pong!")
	}
	if m.Content == "pong" {
		s.ChannelMessageSend(m.ChannelID, "Ping!")
	}
	r := regexp.MustCompile("^!addCharacter ([0-9]+)$")
	match := r.FindStringSubmatch(m.Content)
	if len(match) > 0 {
		id, _ := strconv.Atoi(match[1])
		users.AddCharacter(m, s, id)
	}
	if m.Content == "!chan" {
		s.ChannelMessageSend(m.ChannelID, "Channel id : "+m.ChannelID)
	}
}
func messageCreate ( s * discordgo . Session , m * discordgo . MessageCreate ) { if m . Author . ID == s . State . User . ID { return } if m . Content == " " { s . ChannelMessageSend ( m . ChannelID , " " ) } if m . Content == " " { s . ChannelMessageSend ( m . ChannelID , " " ) } r := regexp . MustCompile ( " " ) match := r . FindStringSubmatch ( m . Content ) if len ( match ) > 0 { id , _ := strconv . Atoi ( match [ 1 ] ) users . AddCharacter ( m , s , id ) } if m . Content == " " { s . ChannelMessageSend ( m . ChannelID , " " + m . ChannelID ) } }
This function will be called (due to AddHandler above) every time a new
message is created on any channel that the autenticated bot has access to.
This function will be called ( due to AddHandler above ) every time a new message is created on any channel that the autenticated bot has access to .
// Ignore all messages created by the bot itself // This isn't required in this specific example but it's a good practice. // If the message is "ping" reply with "Pong!" // If the message is "pong" reply with "Ping!" /*TEST NEW FUNCTION
	if m.Content == "!watch" {
		users.Watch(m, s)
	}*/ //if m.Content == "!test" { //	users.Check(m, s, viper.GetString("channelID")) //} //go check(s, m)