master
Marc 2021-05-29 14:07:32 +01:00
parent 6b5360a08e
commit 373a31e5b7
No known key found for this signature in database
GPG Key ID: 0657563F705ACAAE
1 changed files with 7 additions and 0 deletions

View File

@ -50,6 +50,12 @@ func (o *Overwatch) ProcessMessage(s *discordgo.Session, m interface{}) {
func (o *Overwatch) handleUserStat(s *discordgo.Session, m *discordgo.MessageCreate) error { func (o *Overwatch) handleUserStat(s *discordgo.Session, m *discordgo.MessageCreate) error {
userID := m.Author.ID userID := m.Author.ID
if userID == s.State.User.ID {
// Ignore bots own actions
return nil
}
user, ok := o.UserMessages[userID] user, ok := o.UserMessages[userID]
if !ok { if !ok {
o.UserMessages[userID] = &UserMessageStat{ o.UserMessages[userID] = &UserMessageStat{
@ -83,6 +89,7 @@ func (o *Overwatch) handleServerJoin(s *discordgo.Session, m *discordgo.GuildMem
// this is fucking amazing code // this is fucking amazing code
func (o *Overwatch) Run() { func (o *Overwatch) Run() {
// this shit needs a go channel
// State of the art anti-spam loop // State of the art anti-spam loop
go func() { go func() {
for range time.Tick(5 * time.Second) { for range time.Tick(5 * time.Second) {