diff options
author | Jordan <me@jordan.im> | 2021-12-04 01:14:13 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2021-12-04 01:14:13 -0700 |
commit | 22bda245fb3cb8da20cff8be53e0261c77240623 (patch) | |
tree | 94396edc7c2415dd87ebd26ac251e379d26ce116 | |
parent | af2549c3efb509418f4a24476a13b40673ea7186 (diff) | |
download | keep-22bda245fb3cb8da20cff8be53e0261c77240623.tar.gz keep-22bda245fb3cb8da20cff8be53e0261c77240623.zip |
misc: housekeeping
-rw-r--r-- | archive.go | 6 | ||||
-rw-r--r-- | go.mod | 6 | ||||
-rw-r--r-- | keep.go | 4 |
3 files changed, 8 insertions, 8 deletions
@@ -15,7 +15,7 @@ var ( TIMEOUT time.Duration = 25 client *http.Client = &http.Client{Timeout: TIMEOUT * time.Second} - blocklist = []string{"cdn.discordapp.com", "discord.com", "tenor.com", + ignoreList = []string{"cdn.discordapp.com", "discord.com", "tenor.com", "c.tenor.com", "archive.org", "web.archive.org", "youtu.be", "youtube.com", "www.youtube.com", "discord.gg", "media.discordapp.net", "open.spotify.com"} @@ -34,9 +34,9 @@ type Closest struct { Status string `json:"status"` } -func isBlacklisted(host string) bool { +func isIgnored(host string) bool { - for _, h := range blocklist { + for _, h := range ignoreList { if host == h { return true @@ -3,7 +3,7 @@ module keep go 1.16 require ( - github.com/bwmarrin/discordgo v0.23.2 // indirect - github.com/mattn/go-sqlite3 v1.14.9 // indirect - golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c // indirect + github.com/bwmarrin/discordgo v0.23.2 + github.com/mattn/go-sqlite3 v1.14.9 + golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c ) @@ -169,8 +169,8 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { continue } - // Ensure host is not present in blacklisted set - if isBlacklisted(u.Host) { + // Ensure host is not present in ignoreList set + if isIgnored(u.Host) { continue } |