PrivateParlorXT::DocumentHandler
Inherits PrivateParlorXT::UpdateHandler < PrivateParlorXT::Handler < Reference < Object
A handler for files and document message updates
Instance methods
Checks if the document message meets requirements and relays it
Returns true if the message meets requirements
Returns `false if the message does not meet requirements, when the message is a forward, part of an album, or an animation/GIF
Checks if the user is spamming documents
Returns true if the user is spamming documents, false otherwise
spend_karma(user : User, services : Services) : User
Returns the User with decremented karma when KarmaHandler is enabled and
user has sufficient karma for a document
Checks if the user has sufficient karma to send a document when KarmaHandler is enabled
Returns true if:
KarmaHandleris not enabled- The price for documents is less than 0
- The user's
Rankis equal to or greater than the cutoffRank - User has sufficient karma
Returns nil if the user does not have sufficient karma