cronokirby / alchemy

A discord library for Elixir
MIT License
152 stars 34 forks source link

Fix `Alchemy.Reactions.Emoji.resolve/1` crashing all reaciton management related functions #112

Open aramsm opened 4 years ago

aramsm commented 4 years ago

Fixes #109

Description

The Alchemy.Reactions.Emoji.resolve/1 considers only two scenarios:

In this second scenario, this function is building the struct in a wrong way when the paramater is a map. This causes Elixir to crash when it tries to convert the emoji's name to string (this is required to build the url, so Uri can encode it here for example). With this fix, this function will do a proper job when the parameter is a map.

aramsm commented 3 years ago

@cronokirby how are you? I would like to know if you could merge this PR. Also, since the PR fixing the channels did not bring up the project version, I can not pull that update from this lib and my bot is crashing since I have an annoucement channel on my server now. Merging this PR would fix the project version too.