distinguish method
Distinguish a Comment or Submission.
how
is a DistinctionType value, where yes
distinguishes the content
as a moderator, and no
removes distinction. admin
and special
require special privileges.
If sticky
is true
and the comment is top-level, the Comment will be
placed at the top of the comment thread. If the item to be distinguished
is not a Comment or is not a top-level Comment, this parameter is
ignored.
Implementation
Future<void> distinguish(
{required DistinctionType how, bool sticky = false}) async {
final data = <String, String>{
'how': distinctionTypeToString(how),
'id': content.fullname!,
'api_type': 'json'
};
if (sticky && (content is Comment) && (content as Comment).isRoot) {
data['sticky'] = 'true';
}
return content.reddit.post(apiPath['distinguish'], data);
}