Skip to content

Commit

Permalink
Merge pull request andersfylling#286 from Kelwing/develop
Browse files Browse the repository at this point in the history
implement extremely relaxed emoji matching in hash calculation
  • Loading branch information
andersfylling authored Apr 25, 2020
2 parents 39ba986 + 52fec09 commit de75008
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/httd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (

RegexpSnowflakes = `([0-9]+)`
RegexpURLSnowflakes = `\/` + RegexpSnowflakes + `\/?`
RegexpEmoji = `(\x{D83C}-\x{DFFF}|\x{1F600}-\x{1F6FF}|[\x{2600}-\x{26FF}]|\:[a-zA-Z0-9_]+\:|[a-zA-Z0-9_]+\:[0-9]+)\s?`
RegexpEmoji = `([.^/]+)\s?`
RegexpReactionPrefix = `\/channels\/([0-9]+)\/messages\/\{id\}\/reactions\/`

// Header
Expand Down
1 change: 1 addition & 0 deletions internal/httd/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func TestRequest_RateLimitID(t *testing.T) {
"/channels/540519296640614416/messages/540519319814275089/reactions/🥰/@me": "GET:/channels/540519296640614416/messages/{id}/reactions/{emoji}/@me",
"/channels/486833611564253186/messages/540519319814275089/reactions/🥺/@me": "GET:/channels/486833611564253186/messages/{id}/reactions/{emoji}/@me",
"/channels/486833611564253186/messages/540519319814275089/reactions/🥺 /@me": "GET:/channels/486833611564253186/messages/{id}/reactions/{emoji}/@me",
"/channels/486833611564253186/messages/540519319814275089/reactions/♀️/@me": "GET:/channels/486833611564253186/messages/{id}/reactions/{emoji}/@me",
"/channels/486833611564253186/messages/540519319814275089/reactions/:smiling_face_with_3_hearts:/@me": "GET:/channels/486833611564253186/messages/{id}/reactions/{emoji}/@me",
"/channels/486833611564253186/messages/540519319814275089/reactions/:smiling_face_with_3_hearts:": "GET:/channels/486833611564253186/messages/{id}/reactions/{emoji}",
"/channels/486833611564253186/messages/540519319814275089/reactions/:smiling_face_with_3_hearts:/": "GET:/channels/486833611564253186/messages/{id}/reactions/{emoji}",
Expand Down

0 comments on commit de75008

Please sign in to comment.