class SpamScoreHandler
- SpamScoreHandler
- Reference
- Object
Included Modules
- YAML::Serializable
Defined in:
privateparlor/spam_score_handler.crConstructors
Instance Method Summary
- #calculate_spam_score_text(text : String) : Float32
- #downvote_last_used : Hash(Int64, Time)
- #expire
- #score_animation : Float32
- #score_audio : Float32
- #score_base_message : Float32
- #score_basketball : Float32
- #score_bowling : Float32
- #score_contact : Float32
- #score_dart : Float32
- #score_dice : Float32
- #score_document : Float32
- #score_forwarded_message : Float32
- #score_location : Float32
- #score_media_group : Float32
- #score_photo : Float32
- #score_poll : Float32
- #score_slot_machine : Float32
- #score_soccerball : Float32
- #score_sticker : Float32
- #score_text_character : Float32
- #score_text_linebreak : Float32
- #score_venue : Float32
- #score_video : Float32
- #score_video_note : Float32
- #score_voice : Float32
- #scores : Hash(Int64, Float32)
- #sign_last_used : Hash(Int64, Time)
- #spam_limit : Float32
- #spam_limit_hit : Float32
-
#spammy?(user : Int64, increment : Float32) : Bool
Check if user's spam score triggers the spam filter
-
#spammy_downvote?(user : Int64, interval : Int32) : Bool
Check if user has downvoted within an interval of time
-
#spammy_sign?(user : Int64, interval : Int32) : Bool
Check if user has signed within an interval of time
-
#spammy_upvote?(user : Int64, interval : Int32) : Bool
Check if user has upvoted within an interval of time
- #upvote_last_used : Hash(Int64, Time)
Constructor Detail
Instance Method Detail
def spammy?(user : Int64, increment : Float32) : Bool
#
Check if user's spam score triggers the spam filter
Returns true if score is greater than spam limit, false otherwise.
def spammy_downvote?(user : Int64, interval : Int32) : Bool
#
Check if user has downvoted within an interval of time
Returns true if so (user is downvoting too often), false otherwise.
def spammy_sign?(user : Int64, interval : Int32) : Bool
#
Check if user has signed within an interval of time
Returns true if so (user is sign spamming), false otherwise.
def spammy_upvote?(user : Int64, interval : Int32) : Bool
#
Check if user has upvoted within an interval of time
Returns true if so (user is upvoting too often), false otherwise.