Skip to content

Commit

Permalink
remove spammy logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishjh-bst committed Jun 28, 2024
1 parent 9afc76d commit 62f4bee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions moderation/modlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ var (
)

func CreateModlogEmbed(config *Config, author *discordgo.User, action ModlogAction, target *discordgo.User, reason, logLink string) error {
logger.Infof("%#v", config)
logger.Infof("Creating modlog embed for guild_id %d, action_channel %d", config.GuildID, config.ActionChannel)
channelID := config.ActionChannel
if channelID == 0 {
return nil
Expand Down
5 changes: 1 addition & 4 deletions moderation/punishments.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ func punish(config *Config, p Punishment, guildID int64, channel *dstate.Channel
}

logger.WithField("guild_id", guildID).Infof("MODERATION: %s %s %s cause %q", author.Username, action.Prefix, user.Username, reason)

if memberNotFound {
logger.WithField("guild_id", guildID).Infof("MODERATION: MEMBER NOT FOUND: %d %s", user.ID, user.Username)
// Wait a tiny bit to make sure the audit log is updated
time.Sleep(time.Second * 3)

Expand Down Expand Up @@ -158,9 +156,8 @@ func punish(config *Config, p Punishment, guildID int64, channel *dstate.Channel
err = CreateModlogEmbed(config, author, action, user, reason, logLink)
if err != nil {
logger.WithError(err).WithField("guild", gs.ID).Error("Failed creating mod log embed")
} else {
logger.WithError(err).WithField("guild", gs.ID).Error("Successfully created mod log embed")
}

return err
}

Expand Down

0 comments on commit 62f4bee

Please sign in to comment.