diff --git a/main.go b/main.go index c7665f9..5062dea 100644 --- a/main.go +++ b/main.go @@ -574,57 +574,3 @@ func sendUpdateDiscordWebhookWithDetails(changes []string) { log.Printf("Discord webhook failed with status %d: %s", resp.StatusCode, string(body)) } } - -func sendUpdateDiscordWebhook() { - log.Println("Sending Discord webhook notification...") - // Create a rich embed message - message := "A lesson on your timetable has changed" - /*embed := Embed{ - Title: "Next Lesson ", - Description: "The next lesson is starting soon: ", - Color: 3066993, // Green color - Timestamp: time.Now().Format(time.RFC3339), - Fields: []Field{ - { - Name: "New Lesson", - // Value: fmt.Sprintf("`%s`", ip), - Value: fmt.Sprintf("Room: %s", room), - Inline: true, - }, - { - Name: "Start-Time", - Value: fmt.Sprintf("Start time: %s", nextTime), - Inline: true, - }, - { - Name: "Status", - Value: fmt.Sprintf("Status: %s", Status), - Inline: true, - }, - }, - } - */ - payload := DiscordWebhookPayload{ - Content: message, - } - - jsonData, err := json.Marshal(payload) - if err != nil { - log.Printf("Error marshaling webhook payload: %v", err) - return - } - - resp, err := http.Post(discordWebhookURL, "application/json", bytes.NewBuffer(jsonData)) - if err != nil { - log.Printf("Error sending Discord webhook: %v", err) - return - } - defer resp.Body.Close() - - if resp.StatusCode >= 200 && resp.StatusCode < 300 { - log.Println("Discord webhook notification sent successfully") - } else { - body, _ := ioutil.ReadAll(resp.Body) - log.Printf("Discord webhook failed with status %d: %s", resp.StatusCode, string(body)) - } -}