Sha256: 7b2be98bc450c00ef2d1102e8fe01df028f4165f07815db1c045c82198c8f5c4

Contents?: true

Size: 489 Bytes

Versions: 1

Compression:

Stored size: 489 Bytes

Contents

# frozen_string_literal: true

# rubocop: disable Style/Documentation

class Time
  #
  # Format a time object to a Discord formatted string.
  #
  # @param ["f", "F", "d", "D", "t", "T", "R"] type The format to use.
  #
  # @return [String] The formatted time.
  #
  def to_df(type = nil)
    type.nil? ? "<t:#{to_i}>" : "<t:#{to_i}:#{type}>"
  end
end

# @private
module Async
  class Node
    alias inspect to_s
  end
end

# rubocop: enable Style/Documentation

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
discorb-0.20.0 lib/discorb/extend.rb