Commit 89adf1d8 authored by Peter van der meulen's avatar Peter van der meulen

Remove comments

parent 67af728e
...@@ -105,14 +105,13 @@ defmodule SnugglesApp.Accounts do ...@@ -105,14 +105,13 @@ defmodule SnugglesApp.Accounts do
{:ok, eve_user} = EveUser.fetch_full(user.character_id) {:ok, eve_user} = EveUser.fetch_full(user.character_id)
{:ok, updated_user } = update_user(user, eve_user) {:ok, updated_user } = update_user(user, eve_user)
Discord.manage_alliance_permissions(updated_user.discord_id, user.access, updated_user.access) Discord.manage_alliance_permissions(updated_user.discord_id, user.access, updated_user.access)
IO.puts "#{user.corp_id}, #{updated_user.corp_id}"
manage_corp_discord_permissions(updated_user, user.corp_id, updated_user.corp_id) manage_corp_discord_permissions(updated_user, user.corp_id, updated_user.corp_id)
Discord.update_user_name(updated_user) Discord.update_user_name(updated_user)
{:ok, updated_user} {:ok, updated_user}
end end
def manage_corp_discord_permissions(_, unchanged, unchanged), do: IO.inspect({:ok, "unchanged"}) def manage_corp_discord_permissions(_, unchanged, unchanged), do: {:ok, "unchanged"}
def manage_corp_discord_permissions(_, nil, _), do: IO.inspect({:ok, "new member"}) def manage_corp_discord_permissions(_, nil, _), do: {:ok, "new member"}
def manage_corp_discord_persmissions(user, old_corp_id, _) do def manage_corp_discord_persmissions(user, old_corp_id, _) do
case Repo.get_by(Corporation, eve_corp_id: old_corp_id) do case Repo.get_by(Corporation, eve_corp_id: old_corp_id) do
......
...@@ -32,10 +32,12 @@ Here are some easy steps to get started: ...@@ -32,10 +32,12 @@ Here are some easy steps to get started:
- The auth role needs access to read the public channel - The auth role needs access to read the public channel
``` ```
The auth role can manage the role below it, not avove. Sort them like: https://i.imgur.com/tPG52MY.png The auth role can manage the role below it, not above. Sort them like: `https://i.imgur.com/tPG52MY.png`
While in this screen edit your normal member role to allow \"anyone to mention this role\"
2. Invite snuggles-auth to your server using this link and give it the auth role: 2. Invite snuggles-auth to your server using this link and give it the auth role:
https://discordapp.com/oauth2/authorize?client_id=#{Application.get_env(:snuggles_app, :discord_snuggles_id)}&scope=bot `https://discordapp.com/oauth2/authorize?client_id=#{Application.get_env(:snuggles_app, :discord_snuggles_id)}&scope=bot`
3. Send a message in your public channel like this: 3. Send a message in your public channel like this:
``` ```
......
...@@ -20,6 +20,6 @@ defmodule SnugglesApp.Discord.Roles do ...@@ -20,6 +20,6 @@ defmodule SnugglesApp.Discord.Roles do
end end
def add_custom_to_user(user_id, guild_id, role_id) do def add_custom_to_user(user_id, guild_id, role_id) do
IO.inspect Nostrum.Api.add_guild_member_role(guild_id, user_id, role_id) Nostrum.Api.add_guild_member_role(guild_id, user_id, role_id)
end end
end end
...@@ -10,7 +10,7 @@ defmodule SnugglesApp.Discord.User do ...@@ -10,7 +10,7 @@ defmodule SnugglesApp.Discord.User do
end end
def set_name(user, guild_id) do def set_name(user, guild_id) do
IO.inspect Nostrum.Api.modify_member( Nostrum.Api.modify_member(
guild_id, guild_id,
user.discord_id, user.discord_id,
%{nick: "[#{user.corp_ticker}] #{user.character_name}"} %{nick: "[#{user.corp_ticker}] #{user.character_name}"}
......
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