ping pong bug fix

This commit is contained in:
da
2017-01-05 23:25:25 +01:00
parent 25e49a946e
commit 3873b1c812
-7
View File
@@ -609,13 +609,6 @@ func handleBotControlMessages(s *discordgo.Session, m *discordgo.MessageCreate,
func onMessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { func onMessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
if m.Content == "ping" || m.Content == "pong" { if m.Content == "ping" || m.Content == "pong" {
u, _ := s.User("@me")
BotID := u.ID
// Ignore all messages created by the bot itself
if m.Author.ID == BotID {
return
}
// If the message is "ping" reply with "Pong!" // If the message is "ping" reply with "Pong!"
if m.Content == "ping" { if m.Content == "ping" {
_, _ = s.ChannelMessageSend(m.ChannelID, "Pong!") _, _ = s.ChannelMessageSend(m.ChannelID, "Pong!")