forked from kageru/discord-selphybot
find wink emotes by regex and delete them
This commit is contained in:
parent
c5389052b8
commit
1b877ce117
7
main.go
7
main.go
|
@ -3,10 +3,11 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"strings"
|
//"strings"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"regexp"
|
||||||
"github.com/bwmarrin/discordgo"
|
"github.com/bwmarrin/discordgo"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -56,8 +57,10 @@ func genericReply(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains(m.Content, ";)") {
|
winks, _ := regexp.MatchString("([()|DoO];|;[()|DoOpP])", m.Content)
|
||||||
|
if winks {
|
||||||
s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("<@%s> faggot", m.Author.ID))
|
s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("<@%s> faggot", m.Author.ID))
|
||||||
|
s.ChannelMessageDelete(m.ChannelID, m.ID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user