module

Dusic::Misc

Instance methods

await(timeout : Time::Span = 10.seconds, interval : Time::Span = 250.milliseconds, &) : Bool

Loops and calls provided block. Stops when timeout is hit (result will be false) or block returns truthy value (result will be true)

Source
color(key : String) : UInt32 | Nil

Return named color UInt32 which can be accepted by Discord

Source
format_seconds(ts : Time::Span) : String

Format time span in format of HH:MM:SS

Source
format_seconds(seconds : Int32) : String
Source
ms_since(time : Time) : Float64

Return milliseconds since moment

Source
run_gc

Manually run GC and log some of it stats

Source
spawn(name : String | Nil = nil, same_thread : Bool = false, &block) : Fiber

Wrapper around default spawn method TODO: Currently it seems to have no use. Consider deleting

Source
t(key : String, options : Hash | NamedTuple | Nil = nil, force_locale = nil, count = nil, default = nil, iter = nil, &block : -> String) : String

Wrapper over I18n.translate

Source
t(*args, **opts) : String
Source