Commit d19d9673 authored by Peter van der meulen's avatar Peter van der meulen

Member role safeguard

parent 2b1f52a5
......@@ -157,7 +157,6 @@ defmodule SnugglesApp.Accounts do
"add corp discord" -> send_admin_corp_creation_help_message(author_id)
_ -> Discord.send_admin_fallback_message(author_id)
end
IO.puts "#{author_id} send: #{content}"
end
defp send_admin_corp_creation_help_message(author_id) do
......@@ -182,15 +181,15 @@ 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"])
true ->
object["guild_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"])
end
end
defp create_corp(user, msg) do
IO.inspect user
IO.inspect msg
attrs = %{
eve_corp_id: user.corp_id,
discord_guild_id: Integer.to_string(msg["guild_id"]),
......
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