[scripts/copy-crosscode-emoji-url] add an option for allowing nsfw emotes

This commit is contained in:
Keanu Timmermans 2021-04-26 18:13:10 +02:00
commit a1ae96a050
Signed by: keanucode
GPG key ID: A7431C0D513CA93B

View file

@ -51,7 +51,8 @@ def emote_downloader_and_iterator() -> Generator[str, None, None]:
assert emote_registry_data["version"] == 1
emotes = [emote for emote in emote_registry_data["list"]]
allow_nsfw = config.getboolean("default", "allow_nsfw", fallback=False)
emotes = [emote for emote in emote_registry_data["list"] if emote["safe"] or allow_nsfw]
for emote in emotes:
yield "{emote[ref]} [{emote[guild_name]}]".format(emote=emote)