about summary refs log tree commit diff stats
path: root/main.go
diff options
context:
space:
mode:
authorBenny Morrison <benmorrison@ttm.sh>2019-03-16 00:52:07 -0400
committerBenny Morrison <benmorrison@ttm.sh>2019-03-16 00:52:07 -0400
commit42ced13208bb67dd99f399dbd1c5345728b41da4 (patch)
tree79e53be87d83dc5a485d7705613332852c606962 /main.go
parent39a58b2ad538066ea5ebe77cbce9c79878c398e6 (diff)
downloadgoofbot-42ced13208bb67dd99f399dbd1c5345728b41da4.tar.gz
added !join function
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.go b/main.go
index 82ca0fe..cb73673 100644
--- a/main.go
+++ b/main.go
@@ -12,6 +12,8 @@ import (
 )
 
 func main() {
+	// OWNER NICK
+	owner := "ahriman"
 	// CLIENT CONFIG
 	client := girc.New(girc.Config{
 		Server: "irc.tilde.chat",
@@ -38,7 +40,7 @@ func main() {
 
 		// check if the command was issued by a specific person before dying
 		// i had to delve into girc/commands.go to find e.Source.Name
-		if strings.HasPrefix(e.Last(), "die, devil bird!") && e.Source.Name == "ahriman" {
+		if strings.HasPrefix(e.Last(), "die, devil bird!") && e.Source.Name == owner {
 			c.Cmd.Reply(e, "SQUAWWWWWK!!")
 			time.Sleep(100 * time.Millisecond)
 			c.Close()
@@ -49,6 +51,12 @@ func main() {
 			c.Cmd.Reply(e, "Creator: ~a h r i m a n~ :: I'm the assistance bot for tilde.institute. Commands: !hello")
 			return
 		}
+		// when requested by owner, join channel specified
+		if strings.HasPrefix(e.Last(), "!join") && e.Source.Name == owner {
+			c.Cmd.Reply(e, "Right away, cap'n!")
+			time.sleep(100 * time.Millisecond)
+			c.Cmd.Join(e.Params[0])
+		}
 		// respond with uptime / load
 		if strings.HasPrefix(e.Last(), "!uptime") {
 			uptime := exec.Command("uptime")