diff options
author | Jordan Bracco <href@random.sh> | 2022-12-11 17:19:11 +0000 |
---|---|---|
committer | Jordan Bracco <href@random.sh> | 2022-12-11 17:19:11 +0000 |
commit | 4d7812a8b9d824deda745e42cb7aac8e64577013 (patch) | |
tree | 96fb97a251b7cb824c1a7c353aeaad308b179879 /lib/irc/account.ex | |
parent | feat(base-plugin): list enabled plugins with `!plugins` (diff) |
feat(telegram): create account for telegram user
Ref T53
Diffstat (limited to '')
-rw-r--r-- | lib/irc/account.ex | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/irc/account.ex b/lib/irc/account.ex index 28b5141..beb8daa 100644 --- a/lib/irc/account.ex +++ b/lib/irc/account.ex @@ -236,6 +236,12 @@ defmodule IRC.Account do if make_default, do: new_account(user), else: nil end + def new_account(nick) do + id = EntropyString.large_id() + :dets.insert(file("db"), {id, nick, EntropyString.token()}) + get(id) + end + defp new_account(%{nick: nick, network: server}) do id = EntropyString.large_id() :dets.insert(file("db"), {id, nick, EntropyString.token()}) |