SubredditEmoji¶
- class praw.models.reddit.emoji.SubredditEmoji(subreddit)¶
Provides a set of functions to a
Subredditfor emoji.- Parameters:
subreddit (models.Subreddit)
- __getitem__(name)¶
Lazily return the
Emojifor the subreddit namedname.This method is to be used to fetch a specific emoji url, like so:
emoji = reddit.subreddit("test").emoji["emoji"] print(emoji)
- __init__(subreddit)¶
Initialize a
SubredditEmojiinstance.- Parameters:
subreddit (
Subreddit) – The subreddit whose emoji are affected.- Return type:
None
- __iter__()¶
Return a list of
Emojifor 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, mod_flair_only=None, name, post_flair_allowed=None, user_flair_allowed=None)¶
Add an emoji to this subreddit.
- Parameters:
image_path (
str) – A path to a jpeg or png image.mod_flair_only (
bool|None) – When provided, indicate whether the emoji is restricted to mod use only (default:None).name (
str) – The name of the emoji.post_flair_allowed (
bool|None) – When provided, indicate whether the emoji may appear in post flair (default:None).user_flair_allowed (
bool|None) – When provided, indicate whether the emoji may appear in user flair (default:None).
- Return type:
- Returns:
The
Emojiadded.
To add
"emoji"to r/test try:reddit.subreddit("test").emoji.add(name="emoji", image_path="emoji.png")