Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = Nadia.Parser.parse_result(message, nil)
- m = if m.entities do
- entities = Enum.map(
- m.entities,
- fn(entity) ->
- case entity.type do
- "bot_command" -> Map.put(entity, :bot_command, m.text |> String.slice(entity.offset, entity.length) |> String.trim("/"))
- _ -> entity
- end
- end
- )
- %{m | entities: entities}
- end
- m
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement