Commit 81b18a6d authored by Peter van der meulen's avatar Peter van der meulen

Fix signup

parent d19d9673
......@@ -181,11 +181,12 @@ defmodule SnugglesApp.Accounts do
Discord.send_message("Hey <@#{object["author_id"]}>, You need to auth yourself in the alliance first", object["channel_id"])
corp != nil ->
Discord.send_message("Hey <@#{object["author_id"]}>, It looks like your corp is already registered with a discord server", object["channel_id"])
object["guild_id"] && true ->
object["role_id"] && true ->
{:ok, _} = create_corp(user, object)
Discord.send_message("Hey #{user.corp_ticker}, \nYour corporation is now registered with its own auth. \nYour members can write `!auth-corp` in the alliance landing pad to receive rights on this server", object["channel_id"])
true ->
Discord.send_message("Hey #{user.corp_ticker}, \nIt looks like i can't read the member role you mentioned", object["channel_id"])
IO.inspect(object)
Discord.send_message("Hey #{user.corp_ticker}, \nIt looks like i can't read the member role you mentioned, make sure the setting \"All members can mention this role\" is enabled on the member role. If you still experience issues try clicking the autocomplete when mentioning the role. you can also only manage one member role", object["channel_id"])
end
end
......
......@@ -27,6 +27,8 @@ defmodule SnugglesApp.Discord.PostWorker do
msg.channel_id == @admin_channel_id ->
{:ok, _} = RabbitService.publish_json("account.events", strip_message(msg, "admin"))
corp_creation_message?(msg) ->
IO.puts(msg.content)
IO.puts(msg.mention_roles)
{:ok, _} = RabbitService.publish_json("account.events", strip_corp_message(msg))
to_snuggles?(msg.mentions) ->
Api.create_message(msg.channel_id, "I don't understand that. Sorry")
......@@ -49,7 +51,7 @@ defmodule SnugglesApp.Discord.PostWorker do
to_snuggles?(msg.mentions) &&
msg.guild_id != @guild_id &&
Regex.run(~r/add corp/, msg.content) &&
Enum.count([msg.mention_roles]) == 1
Enum.count(msg.mention_roles) == 1
end
defp exchange(msg) do
......
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