This commit is contained in:
@@ -15,9 +15,21 @@ POSITIVE_REACTIONS = [ReactionKind.ACCEPT.value, ReactionKind.LIKE.value, Reacti
|
||||
NEGATIVE_REACTIONS = [ReactionKind.REJECT.value, ReactionKind.DISLIKE.value, ReactionKind.DISPROOF.value]
|
||||
|
||||
|
||||
def is_negative(x: ReactionKind) -> bool:
|
||||
return x.value in NEGATIVE_REACTIONS
|
||||
def is_negative(x: ReactionKind | str) -> bool:
|
||||
"""Проверяет, является ли реакция негативной.
|
||||
|
||||
Args:
|
||||
x: ReactionKind enum или строка с названием реакции
|
||||
"""
|
||||
value = x.value if isinstance(x, ReactionKind) else x
|
||||
return value in NEGATIVE_REACTIONS
|
||||
|
||||
|
||||
def is_positive(x: ReactionKind) -> bool:
|
||||
return x.value in POSITIVE_REACTIONS
|
||||
def is_positive(x: ReactionKind | str) -> bool:
|
||||
"""Проверяет, является ли реакция позитивной.
|
||||
|
||||
Args:
|
||||
x: ReactionKind enum или строка с названием реакции
|
||||
"""
|
||||
value = x.value if isinstance(x, ReactionKind) else x
|
||||
return value in POSITIVE_REACTIONS
|
||||
|
||||
Reference in New Issue
Block a user