class

PrivateParlorXT::VoiceHandler

Inherits PrivateParlorXT::UpdateHandler < PrivateParlorXT::Handler < Reference < Object

A handler for voice message updates

Instance methods

do(message : Tourmaline::Message, services : Services) : Nil

Checks if the voice message meets requirements and relays it

Source
spamming?(user : User, message : Tourmaline::Message, services : Services) : Bool

Checks if the user is spamming voice messages

Returns true if the user is spamming voice messages, false otherwise

Source
spend_karma(user : User, services : Services) : User

Returns the User with decremented karma when KarmaHandler is enabled and user has sufficient karma for a voice message

Source
sufficient_karma?(user : User, message : Tourmaline::Message, services : Services) : Bool | Nil

Checks if the user has sufficient karma to send a voice message when KarmaHandler is enabled

Returns true if:

  • KarmaHandler is not enabled
  • The price for voice messages is less than 0
  • The user's Rank is equal to or greater than the cutoff Rank
  • User has sufficient karma

Returns nil if the user does not have sufficient karma

Source