SubredditEmoji

class praw.models.reddit.emoji.SubredditEmoji(subreddit: praw.models.Subreddit)

Provides a set of functions to a Subreddit for emoji.

__getitem__(name: str) Emoji

Lazily return the Emoji for the subreddit named name.

Parameters

name – The name of the emoji.

This method is to be used to fetch a specific emoji url, like so:

emoji = reddit.subreddit("test").emoji["emoji"]
print(emoji)
__init__(subreddit: praw.models.Subreddit)

Initialize a SubredditEmoji instance.

Parameters

subreddit – The subreddit whose emoji are affected.

__iter__() List[Emoji]

Return a list of Emoji for the subreddit.

This method is to be used to discover all emoji for a subreddit:

for emoji in reddit.subreddit("test").emoji:
    print(emoji)
add(*, image_path: str, mod_flair_only: Optional[bool] = None, name: str, post_flair_allowed: Optional[bool] = None, user_flair_allowed: Optional[bool] = None) Emoji

Add an emoji to this subreddit.

Parameters
  • image_path – A path to a jpeg or png image.

  • mod_flair_only – When provided, indicate whether the emoji is restricted to mod use only (default: None).

  • name – The name of the emoji.

  • post_flair_allowed – When provided, indicate whether the emoji may appear in post flair (default: None).

  • user_flair_allowed – When provided, indicate whether the emoji may appear in user flair (default: None).

Returns

The Emoji added.

To add "emoji" to r/test try:

reddit.subreddit("test").emoji.add(name="emoji", image_path="emoji.png")