Packages

Elixir library for building Telegram bots with macro-based API

Current section

Files

Jump to
telegram_ex lib types message.ex
Raw

lib/types/message.ex

defmodule TelegramEx.Types.Message do
defstruct [
:message_id,
:from,
:chat,
:date,
:text,
:photo,
:document,
:sticker,
:video,
:voice,
:caption
]
def from_map(map) do
%__MODULE__{
message_id: map["message_id"],
from: map["from"],
chat: map["chat"],
date: map["date"],
text: Map.get(map, "text", ""),
photo: map["photo"],
document: map["document"],
sticker: map["sticker"],
video: map["video"],
voice: map["voice"],
caption: map["caption"]
}
end
end