Skip to content

Commit 4194720

Browse files
committedAug 2, 2018
Allow multi-word terms with Urban Dictionary
1 parent 0ef6ed7 commit 4194720

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎cmd-urbandictionary.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import (
55
"net/url"
66
"regexp"
77
"strconv"
8+
"strings"
89

910
"github.com/JoshuaDoes/urbandictionary"
1011
//prettyTime "github.com/andanhm/go-prettytime"
1112
"github.com/bwmarrin/discordgo"
1213
)
1314

1415
func commandUrbanDictionary(args []string, env *CommandEnvironment) *discordgo.MessageEmbed {
15-
results, err := urbandictionary.Query(args[0])
16+
results, err := urbandictionary.Query(strings.Join(args, " "))
1617
if err != nil {
1718
return NewErrorEmbed("Urban Dictionary Error", "There was an error getting a result for that term.")
1819
}

0 commit comments

Comments
 (0)
Please sign in to comment.