From 8caa4b20d43ccaf352dc0bbe9f32f39b13503451 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Wed, 18 Jul 2018 10:10:54 +0200 Subject: [PATCH] fix: correct create_message/2 clause --- lib/rest.ex | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/rest.ex b/lib/rest.ex index 209e9ab..a418108 100644 --- a/lib/rest.ex +++ b/lib/rest.ex @@ -106,9 +106,6 @@ defmodule Crux.Rest do def create_message(%Message{channel_id: channel_id}, args), do: create_message(channel_id, args) def create_message(%Channel{id: channel_id}, args), do: create_message(channel_id, args) - def create_message(channel_id, not_map) when not is_map(not_map), - do: create_message(channel_id, Map.new(not_map)) - def create_message(channel_id, %{files: files} = args) when is_number(channel_id) do Enum.reduce_while(files, [], fn file, acc -> with {:error, error} <- Util.map_file(file) do @@ -136,8 +133,7 @@ defmodule Crux.Rest do end end - def create_message(channel_id, args), - do: real_create_message(channel_id, Map.new(not_map)) + def create_message(channel_id, args), do: real_create_message(channel_id, Map.new(args)) defp real_create_message(channel_id, args, disposition \\ []) do Rest.Base.queue(:post, Endpoints.channel_messages(channel_id), args, disposition)