Browse Source

No blank links

master
Gregory Rudolph 2 years ago
parent
commit
8af3e9656d
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 6
      commands.go

6
commands.go

@ -292,12 +292,14 @@ func Status(b BotCommand) bool { @@ -292,12 +292,14 @@ func Status(b BotCommand) bool {
func WhitelistURL(b BotCommand) bool {
defer log.PanicSafe()
config.WhitelistURLs = append(config.WhitelistURLs, strings.TrimSpace(
newURL := strings.TrimSpace(
strings.ReplaceAll(
strings.ReplaceAll(b.Message.Content, b.Command, ""),
"<@688025671968096341>", ""),
),
)
if len(newURL) > 0 {
config.WhitelistURLs = append(config.WhitelistURLs, newURL)
}
domains := strings.Join(config.WhitelistURLs, "\n")
b.Session.ChannelMessageSend(config.AdminChannel, fmt.Sprintf("Current whitelisted domains: %+v", domains))
log.LogDebug(fmt.Sprintf("Current whitelisted domains: %+v", domains))

Loading…
Cancel
Save