Commit 06e2aee9 authored by Peter van der meulen's avatar Peter van der meulen

Small fixes and expantions

parent 873a6e36
......@@ -48,7 +48,7 @@ defmodule SnugglesApp.Discord do
defp add_default_role_to_user(discord_id) do
{:ok} = Roles.add_default_to_user(discord_id)
{:ok, _} = send_message_to_admin("<@#{discord_id}> reveived member rights")
{:ok, _} = send_message_to_admin("<@#{discord_id}> received member rights")
end
defp remove_default_role_from_user(discord_id) do
......
......@@ -5,7 +5,7 @@ defmodule SnugglesApp.Discord.User do
Nostrum.Api.modify_member(
@guild_id,
user.discord_id,
%{nick: "[#{user.corp_ticker}] #{user.character_name}"}
user_name(user)
)
end
......@@ -13,7 +13,13 @@ defmodule SnugglesApp.Discord.User do
Nostrum.Api.modify_member(
guild_id,
user.discord_id,
%{nick: "[#{user.corp_ticker}] #{user.character_name}"}
user_name(user)
)
end
def user_name(user) do
name = "[#{user.corp_ticker}] #{user.character_name}"
new_name = Phoenix.HTML.SimplifiedHelpers.Truncate.truncate name, length: 31, separator: " ", omission: ""
%{nick: new_name}
end
end
......@@ -26,7 +26,8 @@ defmodule SnugglesApp.Mixfile do
:phoenix_cowboy2,
:ranch,
:cowlib,
:cowboy]
:cowboy,
:phoenix_html_simplified_helpers]
]
end
......@@ -56,6 +57,7 @@ defmodule SnugglesApp.Mixfile do
{:httpoison, "~> 0.13"},
{:phoenix_html, "~> 2.10"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:phoenix_html_simplified_helpers, "~> 1.3"},
]
end
......
......@@ -2,6 +2,7 @@
"amqp": {:hex, :amqp, "1.0.0", "fb9c921c7fa50f432bb9a3cf6a944c08cca351f83f5f51517eff1c3334344dea", [:mix], [{:amqp_client, "~> 3.7.3", [hex: :amqp_client, repo: "hexpm", optional: false]}, {:goldrush, "~> 0.1.0", [hex: :goldrush, repo: "hexpm", optional: false]}, {:jsx, "~> 2.8", [hex: :jsx, repo: "hexpm", optional: false]}, {:lager, "~> 3.5", [hex: :lager, repo: "hexpm", optional: false]}, {:rabbit_common, "~> 3.7.3", [hex: :rabbit_common, repo: "hexpm", optional: false]}, {:ranch, "~> 1.4", [hex: :ranch, repo: "hexpm", optional: false]}, {:ranch_proxy_protocol, "~> 1.4", [hex: :ranch_proxy_protocol, repo: "hexpm", optional: false]}, {:recon, "~> 2.3.2", [hex: :recon, repo: "hexpm", optional: false]}], "hexpm"},
"amqp_client": {:hex, :amqp_client, "3.7.3", "29a818d3871de5f8484e876ad34b0a940b2cecd6c6dfbed30d9b1679072eb9bc", [:make, :rebar3], [{:rabbit_common, "3.7.3", [hex: :rabbit_common, repo: "hexpm", optional: false]}], "hexpm"},
"certifi": {:hex, :certifi, "2.3.1", "d0f424232390bf47d82da8478022301c561cf6445b5b5fb6a84d49a9e76d2639", [:rebar3], [{:parse_trans, "3.2.0", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"},
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm"},
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"},
"cowboy": {:git, "https://github.com/ninenines/cowboy.git", "d3f15cfd8b2bb4c0c697bd995dfa4546474235ad", [ref: "2.0.0"]},
"cowlib": {:git, "https://github.com/ninenines/cowlib.git", "ab37df9d5273ea8541dbc08f2bd0d00e1b83479a", [ref: "master"]},
......@@ -27,6 +28,7 @@
"phoenix_cowboy2": {:git, "https://github.com/voicelayer/phoenix_cowboy2.git", "bdb3da744f4364cb50509fd14ee57f9cf16ef106", []},
"phoenix_ecto": {:hex, :phoenix_ecto, "3.3.0", "702f6e164512853d29f9d20763493f2b3bcfcb44f118af2bc37bb95d0801b480", [:mix], [{:ecto, "~> 2.1", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.9", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"},
"phoenix_html": {:hex, :phoenix_html, "2.10.5", "4f9df6b0fb7422a9440a73182a566cb9cbe0e3ffe8884ef9337ccf284fc1ef0a", [:mix], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"},
"phoenix_html_simplified_helpers": {:hex, :phoenix_html_simplified_helpers, "1.3.2", "5f713c5d8f0f1788d34a58b94ae76578b308707900c6eea5820dbd5730729a80", [:mix], [{:ecto, "~> 2.1", [hex: :ecto, repo: "hexpm", optional: false]}, {:gettext, ">= 0.11.0", [hex: :gettext, repo: "hexpm", optional: false]}, {:timex, "~> 3.1", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.1.3", "1d178429fc8950b12457d09c6afec247bfe1fcb6f36209e18fbb0221bdfe4d41", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.0 or ~> 1.2 or ~> 1.3", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "1.0.2", "bfa7fd52788b5eaa09cb51ff9fcad1d9edfeb68251add458523f839392f034c1", [:mix], [], "hexpm"},
"plug": {:hex, :plug, "1.3.6", "bcdf94ac0f4bc3b804bdbdbde37ebf598bd7ed2bfa5106ed1ab5984a09b7e75f", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1", [hex: :cowboy, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}], "hexpm"},
......@@ -40,5 +42,7 @@
"recon": {:hex, :recon, "2.3.2", "4444c879be323b1b133eec5241cb84bd3821ea194c740d75617e106be4744318", [:rebar3], [], "hexpm"},
"redix": {:hex, :redix, "0.7.1", "25a6c1c0d9b2d12a35aef759f9e49bd9bca00e0cd857ce766412f08fdda72163", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], [], "hexpm"},
"timex": {:hex, :timex, "3.2.2", "f83c655ecb9472d4a614c3d27ce98483698ad81736647cba74425c33bcd3c7fb", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm"},
"tzdata": {:hex, :tzdata, "0.5.16", "13424d3afc76c68ff607f2df966c0ab4f3258859bbe3c979c9ed1606135e7352", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.3.1", "a1f612a7b512638634a603c8f401892afbf99b8ce93a45041f8aaca99cadb85e", [:rebar3], [], "hexpm"},
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment