Emoji

class praw.models.reddit.emoji.Emoji(reddit: praw.Reddit, subreddit: praw.models.Subreddit, name: str, _data: Optional[Dict[str, Any]] = None)

An individual Emoji object.

Typical Attributes

Note

This table describes attributes that typically belong to objects of this class. PRAW dynamically provides the attributes that Reddit returns via the API. Since those attributes are subject to change on Reddit’s end, PRAW makes no effort to document any new/removed/changed attributes, other than to instruct you on how to discover what is available. As a result, this table of attributes may not be complete. See Determine Available Attributes of an Object for detailed information.

If you would like to add an attribute to this table, feel free to open a pull request.

Attribute

Description

mod_flair_only

Whether the emoji is restricted for mod use only.

name

The name of the emoji.

post_flair_allowed

Whether the emoji may appear in post flair.

url

The URL of the emoji image.

user_flair_allowed

Whether the emoji may appear in user flair.

__init__(reddit: praw.Reddit, subreddit: praw.models.Subreddit, name: str, _data: Optional[Dict[str, Any]] = None)

Initialize an Emoji instance.

delete()

Delete an emoji from this subreddit by Emoji.

To delete "emoji" as an emoji on r/test try:

reddit.subreddit("test").emoji["emoji"].delete()
classmethod parse(data: Dict[str, Any], reddit: praw.Reddit) Any

Return an instance of cls from data.

Parameters
  • data – The structured data.

  • reddit – An instance of Reddit.

update(mod_flair_only: Optional[bool] = None, post_flair_allowed: Optional[bool] = None, user_flair_allowed: Optional[bool] = None)

Update the permissions of an emoji in this subreddit.

Parameters
  • mod_flair_only – Indicate whether the emoji is restricted to mod use only. Respects pre-existing settings if not provided.

  • post_flair_allowed – Indicate whether the emoji may appear in post flair. Respects pre-existing settings if not provided.

  • user_flair_allowed – Indicate whether the emoji may appear in user flair. Respects pre-existing settings if not provided.

Note

In order to retain pre-existing values for those that are not explicitly passed, a network request is issued. To avoid that network request, explicitly provide all values.

To restrict the emoji "emoji" in r/test to mod use only, try:

reddit.subreddit("test").emoji["emoji"].update(mod_flair_only=True)