Learning BE and Elm

So I am working with some code from the intel bot: bots/Bot.elm at e1c4dac983b8fdb597942ba02025b1d450ee8932 · Viir/bots · GitHub

my modified section of code below. trying to print out the list of pilots in local. but i can’t seem to figure out how to deal with lists correctly, and the maybe object type is also not helping. Any help would be appreciated. my thoughts were to get the list pilots then pull out each name and concat them to one string. but I get errors related to trying to disect the list.
chatWindowReport =
“I see "
++ (localChatWindow.visibleUsers |> List.length |> String.fromInt)
++ " users in the local chat. "
++ (subsetOfUsersWithBadStanding |> List.length |> String.fromInt)
++ " with bad standing.”
++ ( stringLocalUsersFromList localChatWindow.visibleUsers)

alarmRequests =
	if 1 < (subsetOfUsersWithBadStanding |> List.length) then
		[ EveOnline.BotFramework.EffectConsoleBeepSequence
			[ { frequency = 700, durationInMs = 1000 }
			, { frequency = 0, durationInMs = 1000 }
			, { frequency = 700, durationInMs = 5000 }
			]
		]

	else
		[]
in
( alarmRequests, chatWindowReport )

stringLocalUsersFromList : List EveOnline.MemoryReading.ChatUserEntry -> String
stringLocalUsersFromList  users =
 List.map getUserName
  |> String.concat
  |> Maybe.withDefault "bad list"



getUserName : EveOnline.MemoryReading.ChatUserEntry -> String
getUserName user =
	case user of
	   Nothing -> "sorry no users"
	   Just val -> user.name

I found a newer version of the intel bot that is easier to work with: bots/implement/applications/eve-online/eve-online-local-watch/src/Bot.elm at 8df52d373315bd5aa41a9d4a0ceef6ea6aa16bff · Viir/bots · GitHub

Starting from that version, I add the code to print the list of pilots.

I divide the implementation into multiple commits, to make it easier to follow.
The first change only copies the code you posted:

The next commit fixes the new functions:

To pull out the name of the ChatUserEntry, I add .name in the getUserName function:

stringLocalUsersFromList : List EveOnline.MemoryReading.ChatUserEntry -> String
stringLocalUsersFromList users =
    users
        |> List.map getUserName
        |> String.concat

getUserName : EveOnline.MemoryReading.ChatUserEntry -> String
getUserName user =
    user.name
        |> Maybe.withDefault "Failed to read this users name"

Since you were using a case syntax in your code: You could achieve the same functionality with this syntax:

getUserName : EveOnline.MemoryReading.ChatUserEntry -> String
getUserName user =
    case user.name of
        Nothing ->
            "Failed to read this users name"

        Just userName ->
            userName

The next change integrates the string into the display:

I also added another change to make the list of pilots easier to read:

stringLocalUsersFromList : List EveOnline.MemoryReading.ChatUserEntry -> String
stringLocalUsersFromList users =
    users
        |> List.map getUserName
        |> String.join ", "

that works much better, thanks for the commit changes + notes.

separate note, do i have to do anything to make the beep warnings work?
I am getting the status text in the console, but no noises are being made in the game.

case parsedUserInterface |> localChatWindowFromUserInterface of
CanNotSeeIt →
( [ EveOnline.BotFramework.EffectConsoleBeepSequence
[ { frequency = 700, durationInMs = 100 }
, { frequency = 0, durationInMs = 100 }
, { frequency = 700, durationInMs = 100 }
, { frequency = 400, durationInMs = 100 }
]
]
, “I don’t see the local chat window.”
)

Let’s have a closer look into your setup: How many different tones do you hear when running this bot: bots/implement/applications/eve-online/eve-online-demo-sound at 55e32e5f06e12445fcea0dc7081dcdef707e6ba0 · Viir/bots · GitHub

?