~singpolyma/cheogram

159d54f4579f8cea5baf341b6d4c08e41204ca7d — Stephen Paul Weber 8 months ago dbfd94f
List possible actions so user knows what to do
1 files changed, 3 insertions(+), 0 deletions(-)

M Adhoc.hs
M Adhoc.hs => Adhoc.hs +3 -0
@@ 592,6 592,9 @@ adhocBotRunCommand db componentJid routeFrom sendMessage sendIQ getMessage from 
					if null $ XML.elementChildren returnForm then do
						let actions = mapMaybe (actionFromXMPP . XML.nameLocalName . elementName) $ elementChildren =<< isNamed (s"{http://jabber.org/protocol/commands}actions") =<< elementChildren payload
						let sessionid = maybe [] (\sessid -> [(s"sessionid", [ContentText sessid])]) $ attributeText (s"sessionid") payload
						sendText $
							s"You can say one of: " ++
							(intercalate (s", ") $ map actionCmd (ActionCancel : actions))
						action <- waitForAction actions sendText (atomicUIO getMessage)
						let cmdIQ' = (emptyIQ IQSet) {
							iqFrom = Just routeFrom,