class SpamScoreHandler

Included Modules

Defined in:

privateparlor/spam_score_handler.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]

Instance Method Detail

def calculate_spam_score_text(text : String) : Float32 #

[View source]
def downvote_last_used : Hash(Int64, Time) #

[View source]
def expire #

[View source]
def score_animation : Float32 #

[View source]
def score_audio : Float32 #

[View source]
def score_base_message : Float32 #

[View source]
def score_basketball : Float32 #

[View source]
def score_bowling : Float32 #

[View source]
def score_contact : Float32 #

[View source]
def score_dart : Float32 #

[View source]
def score_dice : Float32 #

[View source]
def score_document : Float32 #

[View source]
def score_forwarded_message : Float32 #

[View source]
def score_location : Float32 #

[View source]
def score_media_group : Float32 #

[View source]
def score_photo : Float32 #

[View source]
def score_poll : Float32 #

[View source]
def score_slot_machine : Float32 #

[View source]
def score_soccerball : Float32 #

[View source]
def score_sticker : Float32 #

[View source]
def score_text_character : Float32 #

[View source]
def score_text_linebreak : Float32 #

[View source]
def score_venue : Float32 #

[View source]
def score_video : Float32 #

[View source]
def score_video_note : Float32 #

[View source]
def score_voice : Float32 #

[View source]
def scores : Hash(Int64, Float32) #

[View source]
def sign_last_used : Hash(Int64, Time) #

[View source]
def spam_limit : Float32 #

[View source]
def spam_limit_hit : Float32 #

[View source]
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.


[View source]
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.


[View source]
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.


[View source]
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.


[View source]
def upvote_last_used : Hash(Int64, Time) #

[View source]