Class: Mastodon::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/elephrame/util/account.rb

Constant Summary collapse

NoBotRegex =
/#?NoBot/i

Instance Method Summary collapse

Instance Method Details

#no_bot?Bool

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!)

Returns:

  • (Bool)


11
12
13
14
# File 'lib/elephrame/util/account.rb', line 11

def no_bot?
  note =~ NoBotRegex ||
    fields.any? {|f| f.name =~ NoBotRegex || f.value =~ NoBotRegex}
end