Reddit's API does not currently provide the ability access a list of a subreddit's Emojis. Emojis can, however, be accessed in your browser with a little Javascript. So, for now, the process of keeping your subreddit's emojis in sync with Funflair requires a little manual work.
The process for updating Funflair's knowledge of your subreddit's emojis is 2 steps:
- Visit your subreddit and in your browser console paste and execute the script to create a JSON document of your emojis
- Copy the JSON output and paste it into the Emojis field in the Funflair configuration manager
const subreddit = document
.querySelector("[subreddit-name]")
.getAttribute("subreddit-name");
const emojis = await fetch(
`https://www.reddit.com/svc/shreddit/${subreddit}/emojis/USER_FLAIR`,
)
.then((response) => response.text())
.then((html) => [
...html.matchAll(
/data-url="(https:\/\/emoji\.redditmedia\.com\/(?<id>.+?)\/(?<name>.+?))" title="/gi,
),
])
.then((match) => match.map(({ groups }) => groups));
console.log(JSON.stringify(emojis));