Closed TellowKrinkle closed 7 years ago
Why not just keep the string argument, and use the new emoji initializer to get the tag?
To me at least, the string argument makes it look like you could just put an emoji there (which you can't, since the emoji won't be URL encoded and will make a bad URL). Since you'll always need to put an emoji through an emoji object to URL encode it anyways, you might as well have the function take an emoji object to have one less step for the person using the API while also making it less confusing.
What Iām saying is, make it possible to put an emoji in the string argument. Initialize an emoji object from the string, and pass the tag to the request.
So make addReaction take a string and then internally convert it to an emoji and get its tag?
Bingo, and for custom emojis they can just pass emoji.tag
. Check if the string is a tag vs a Unicode emoji, and initialize an emoji for Unicode.
How's this?
The strings used by those functions need to be URL encoded to work, but it would be confusing (or was for me at least) to find that message.addReaction("šµ") fails. This way forces them to create an Emoji object using Emoji("šµ") which will get converted to a properly URL-encoded tag before the request is run.