mirror-nourybot/pkg/commands/duckduckgo.go
2024-02-28 11:53:39 +01:00

15 lines
264 B
Go

package commands
import (
"fmt"
"net/url"
)
// DuckDuckGo returns the search url for a given query.
func DuckDuckGo(query string) string {
query = url.QueryEscape(query)
reply := fmt.Sprintf("https://duckduckgo.com/?va=n&hps=1&q=%s", query)
return reply
}