sloop around get_emoji/1 to check is_binary and have a fallthrough
default that returns empty
This commit is contained in:
parent
a9c0f395cb
commit
4257f784bc
@ -157,12 +157,12 @@ def emojify(text, emoji) do
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_emoji(nil), do: []
|
def get_emoji(text) when is_binary(text) do
|
||||||
|
|
||||||
def get_emoji(text) do
|
|
||||||
Enum.filter(@emoji, fn {emoji, _} -> String.contains?(text, ":#{emoji}:") end)
|
Enum.filter(@emoji, fn {emoji, _} -> String.contains?(text, ":#{emoji}:") end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_emoji(_), do: []
|
||||||
|
|
||||||
def get_custom_emoji() do
|
def get_custom_emoji() do
|
||||||
@emoji
|
@emoji
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user