ping pong bug fix
This commit is contained in:
@@ -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!")
|
||||||
|
|||||||
Reference in New Issue
Block a user