7TV does not have a good way to find a user outside of platform lookup. The user must select which platform they chose and what their username is on that platform. I have no way to query based on a given username, only by platform and username.
Common API endpoints for user lookup (Discord is a guess, double check in code?)
- https://7tv.io/v3/users/twitch/%s
- https://7tv.io/v3/users/discord/%s
- https://7tv.io/v3/users/kick/%s
YouTube does not presently function but is there. After we query for the user ID, we can then query for their emoji sets at this endpoint:
This returns an object with emote_sets key that we can use to list off the names of and use their ID as the user selects them. Emote sets are then queried at:
We can find the emotes key has an array of emote objects. Under data and then the host key, we have a base url under url and a files array. The files array contains objects that have these important keys (to us):
- name (filename)
- format (webp, avif, or gif)
- width/height in pixels
- frame_count for number of frames for a given animated emote
- size in bytes
The files are named {1..4}x.{format} representing how large it is, for example 32x32 for 1x and 128x128 for 4x
We then need to replace the text inline and scale it appropriately for our given font size and line height. It might be worth seeing how this is done on Twitch chat.
monorepo as needed https://github.com/SevenTV/SevenTV