shithub: hell

Download patch

ref: bf27ab9c4df3796679e4a34cae0fbfaa4b5684f3
parent: 01b6900da724f9e1ad95856099b2b5372f246687
author: penny <penny@limitedideas.org>
date: Thu Aug 14 23:29:13 EDT 2025

Remember the last post we acted on

--- a/main.go
+++ b/main.go
@@ -33,6 +33,7 @@
 	homeMap := hc.homeMap
 	debugMap := hc.debugMap
 	postref := "a"
+	lastindex := ""
 	interupted := false //use this to check if we were interupted last turn
 	var recentpost *mastodon.Status
 
@@ -92,8 +93,15 @@
 			defer hc.unlock()
 
 			index, content, _ := strings.Cut(arguments, " ")
+			
 			postItem, postOK := homeMap[index]
 			debugItem, debugOK := debugMap[index]
+			
+			if (postOK) {
+				lastindex = index
+			} else {
+				postItem, postOK = homeMap[lastindex]
+			}
 
 			//Contextual commands that need to handle their own requirements
 			switch command {
@@ -123,7 +131,7 @@
 				return
 			}
 
-			if arguments == "" {
+			if arguments == "" && !postOK {
 				fmt.Printf("%v requires an argument\n", command)
 				return
 			}
--