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