if the implementation is recent emojis, then we could use a deque. The deque will be instantiated with a max length of 30 which is consistent with what Apple uses.
from collections import deque
recent_emojis = deque([], maxlen=30)
def update_recent_emojis(emoji_used, recent_emojis : deque):
if emoji_used in recent_emojis:
recent_emojis.remove(emoji_used)