Sha256: c27de9f91001cdb34a2b4e490423ec2250b0828fc5147b16a983aa6a7e51f498

Contents?: true

Size: 386 Bytes

Versions: 3

Compression:

Stored size: 386 Bytes

Contents

module Mastodon
  class Account
    NoBotRegex = /#?NoBot/i
    
    ##
    # Checks to see if a user has some form of "#NoBot" in their bio or in
    # their profile fields (so we can make making friendly bots easier!)
    #
    # @return [Bool]
    
    def no_bot?
      note =~ NoBotRegex ||
        fields.any? {|f| f.name =~ NoBotRegex || f.value =~ NoBotRegex}
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elephrame-0.5.2 lib/elephrame/util/account.rb
elephrame-0.5.1 lib/elephrame/util/account.rb
elephrame-0.5 lib/elephrame/util/account.rb