Packages

a gleam lib for connecting to twitch IRC

Current section

Files

Jump to
gwitch src gwitch.erl
Raw

src/gwitch.erl

-module(gwitch).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([main/0]).
-export_type([log_level/0, log/0]).
-type log_level() :: debug.
-type log() :: level.
-spec main() -> nil.
main() ->
logging_ffi:configure(),
logger:set_primary_config(level, debug),
Subj = twitch@chat:connect(<<"thesneakycrow"/utf8>>, none),
Done = begin
_pipe = gleam_erlang_ffi:new_selector(),
_pipe@1 = gleam@erlang@process:selecting_process_down(
_pipe,
gleam@erlang@process:monitor_process(
gleam@erlang@process:subject_owner(Subj)
),
fun gleam@function:identity/1
),
gleam_erlang_ffi:select(_pipe@1)
end,
case Done of
_ ->
gleam@io:print(<<"exiting...later skater!"/utf8>>)
end.