Thursday, June 04, 2026 1:22:27 AM
> project show esm_website_v1
The unexpected heart of the ESM ecosystem. What started as a simple Rails dashboard has evolved into the command center for thousands of gaming communities, proving that sometimes the best infrastructure projects are the ones you never planned to build.
Details
> discord.rb
# frozen_string_literal: true

class Discord
  def self.client(...)
    new(...)
  end

  attr_reader :client, :base_url

  def initialize(token = nil)
    auth =
      if token
        "Bearer #{token}"
      else
        "Bot #{Settings.discord.token}"
      end

    @client = HTTP.auth(auth)
    @base_url = "https://discord.com/api/v10"
  end

  def guild_channels(guild_id)
    client.get(build_url("/guilds/#{guild_id}/channels"))
  end

  def user_guilds
    client.get(build_url("/users/@me/guilds"))
  end

  private

  def build_url(url)
    "#{base_url}#{url}"
  end
end
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 4294fb2