Friday, September 20, 2024 12:03:40 AM
> settings

Customize


Authenticate

> bot_attribute.rb
# frozen_string_literal: true

class BotAttribute < ApplicationRecord
  attribute :short_name, :string, default: nil
  attribute :maintenance_mode_enabled, :boolean, default: false
  attribute :maintenance_message, :string, default: nil
  attribute :status_type, :string, default: "PLAYING"
  attribute :status_message, :string, default: "!register"
  attribute :community_count, :integer, default: 0
  attribute :server_count, :integer, default: 0
  attribute :user_count, :integer, default: 0

  def self.recalculate
    all.first.update!(
      community_count: Community.all.size,
      server_count: Server.all.size,
      user_count: User.where.not(steam_uid: nil).size
    )
  end
end
All opinions represented herein are my own
- © 2024 itsthedevman
- build 3c15a1b