From 5f15048ca3a34805eca19b43b06e1b2daccd5224 Mon Sep 17 00:00:00 2001 From: Benny Morrison Date: Tue, 19 Mar 2019 02:03:35 -0400 Subject: comment formatting --- main.go | 26 +++++++++++++------------- 1 file 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() { -- cgit 1.4.1-2-gfad0