zveinn пре 1 година
родитељ
комит
3e6a72588a
3 измењених фајлова са 33 додато и 0 уклоњено
  1. 2 0
      .gitignore
  2. 30 0
      mongowrapper/mongowrapper.go
  3. 1 0
      twitch-core.go

+ 2 - 0
.gitignore

@@ -61,6 +61,8 @@ func main() {
 				TWITCH_CLIENT.Connect()
 			} else if ID == 7 {
 				go RenewTokensLoop()
+			} else if ID == 1337 {
+				go TWITCH_CLIENT.POST_INFO()
 			}
 
 		default:

+ 30 - 0
mongowrapper/mongowrapper.go

@@ -63,6 +63,34 @@ func USER_TEST(user tirc.UserStateMessage) {
 	log.Println("State:", user)
 }
 
+func (C *IRC_CLIENT) POST_INFO() {
+	defer func() {
+		r := recover()
+		if r != nil {
+			log.Println(r, string(debug.Stack()))
+		}
+		monitor <- 1337
+	}()
+
+	if C.Client != nil {
+
+		returnText, ok := TextCommands["!twitter"]
+		if ok {
+			TWITCH_CLIENT.Reply(returnText, "")
+		}
+		returnText, ok = TextCommands["!discord"]
+		if ok {
+			TWITCH_CLIENT.Reply(returnText, "")
+		}
+		returnText, ok = TextCommands["!vpn"]
+		if ok {
+			TWITCH_CLIENT.Reply(returnText, "")
+		}
+	}
+
+	time.Sleep(1 * time.Hour)
+}
+
 func (C *IRC_CLIENT) Connect() {
 	defer func() {
 		r := recover()
@@ -84,6 +112,8 @@ func (C *IRC_CLIENT) Connect() {
 	go func() {
 		time.Sleep(3 * time.Second)
 		C.JoinChannels()
+		time.Sleep(3 * time.Second)
+		go TWITCH_CLIENT.POST_INFO()
 	}()
 
 	err := C.Client.Connect()

+ 1 - 0
twitch-core.go

@@ -57,6 +57,7 @@ func InitCommands() {
 	TextCommands["!editor"] = "nvim"
 	TextCommands["!spec"] = "CPU( AMD Ryzen 9 3950X 16-Core Processor  ) RAM( 32GB) GPU( GeForce RTX 2080 Ti )"
 	TextCommands["!youtube"] = "https://www.youtube.com/@keyb1nd"
+	TextCommands["!lurk"] = "ABSOLUTELY NOT ... LURKING IS NOT ALLOWED IN HERE"
 
 	// VPN RELATED
 	TextCommands["!freetrial"] = "All new accounts get 24 hours free trial > https://www.nicelandvpn.is/#/register"