about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenny Morrison <benmorrison@ttm.sh>2019-03-19 02:03:35 -0400
committerBenny Morrison <benmorrison@ttm.sh>2019-03-19 02:03:35 -0400
commit5f15048ca3a34805eca19b43b06e1b2daccd5224 (patch)
treeeb98d3b18f65145e8dc72db32aeffcf8dccd6fc1
parentad9f8d1769ea4d87b2242f50dc80b0350899d5d7 (diff)
downloadgoofbot-5f15048ca3a34805eca19b43b06e1b2daccd5224.tar.gz
comment formatting
-rw-r--r--main.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/main.go b/main.go
index 7406ad1..a206861 100644
--- a/main.go
+++ b/main.go
@@ -25,8 +25,8 @@ func checkerr(err error) {
 }
 
 //Conf ... right now Conf.Pass isn't used,
-//but i'm leaving it so the bot
-//can have a registered nick
+// but i'm leaving it so the bot
+// can have a registered nick
 type Conf struct {
 	Owner  string
 	Chan   string
@@ -40,10 +40,10 @@ type Conf struct {
 }
 
 func main() {
-	//check for config file specified by command line flag -c
+	// check for config file specified by command line flag -c
 	jsonlocation := flag.String("c", "config.json", "Path to config file in JSON format")
 	jsonlocationlong := flag.String("config", "config.json", "Same as -c")
-	//spit out config file structure if requested
+	// spit out config file structure if requested
 	jsonformat := flag.Bool("j", false, "Describes JSON config file fields")
 	jsonformatlong := flag.Bool("json", false, "Same as -j")
 
@@ -70,7 +70,7 @@ func main() {
 		*jsonlocation = *jsonlocationlong
 	}
 
-	//read the config file into a byte array
+	// read the config file into a byte array
 	jsonconf, err := ioutil.ReadFile(*jsonlocation)
 	checkerr(err)
 
@@ -91,12 +91,12 @@ func main() {
 	})
 
 	client.Handlers.Add(girc.CONNECTED, func(c *girc.Client, e girc.Event) {
-		//authenticate with nickserv if pass is set in config file
+		// authenticate with nickserv if pass is set in config file
 		if conf.Pass != "" {
 			c.Cmd.Message("nickserv", "identify "+conf.Pass)
 			time.Sleep(500 * time.Millisecond)
 		}
-		//join initial channel specified in config.json
+		// join initial channel specified in config.json
 		c.Cmd.Join(conf.Chan)
 	})
 
@@ -115,7 +115,7 @@ func main() {
 			c.Close()
 			return
 		}
-		//another basic command/response. required information for the tildeverse
+		// another basic command/response. required information for the tildeverse
 		if strings.HasPrefix(e.Last(), "!botlist") {
 			c.Cmd.Reply(e, "Creator: ~a h r i m a n~ :: I'm the assistance bot for tilde.institute. Commands: !hello !join !uptime !users !totalusers. If you need the assistance of an admin, issue !admin")
 			return
@@ -140,8 +140,8 @@ func main() {
 			c.Cmd.Reply(e, out.String())
 			return
 		}
-		// respond with currently connected users
-		// TODO: prepend names with _ to avoid pings in irc
+		// respond with currently connected users via private message
+		// to avoid pinging the user in IRC
 		if strings.HasPrefix(e.Last(), "!users") {
 			// execs: who -q | awk 'NR==1'
 			// then saves the output to bytestream
@@ -171,8 +171,8 @@ func main() {
 			return
 		}
 		if strings.HasPrefix(e.Last(), "!admin") {
-			//gotify.sh contains a preconstructed curl request that
-			//uses the gotify api to send a notification to admins
+			// gotify.sh contains a preconstructed curl request that
+			// uses the gotify api to send a notification to admins
 			gotify := exec.Command("./gotify.sh")
 			err := gotify.Run()
 			if err == nil {
@@ -187,7 +187,7 @@ func main() {
 	if err := client.Connect(); err != nil {
 		log.Fatalf("an error occurred while attempting to connect to %s: %s", client.Server(), err)
 	}
-	//TODO: figure out sigint handling
+	// TODO: figure out sigint handling
 	//	ctrlc := make(chan os.Signal, 1)
 	//	signal.Notify(ctrlc, os.Interrupt)
 	//	go func() {