From 454c46bf62a5717fc6e44f4c7f9c9a25b9cdcdd5 Mon Sep 17 00:00:00 2001 From: vaporvee Date: Tue, 20 Feb 2024 17:29:33 +0100 Subject: [PATCH] added ping command --- command_ping.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/command_ping.go b/command_ping.go index 3ed997a..7ef8cab 100644 --- a/command_ping.go +++ b/command_ping.go @@ -16,12 +16,10 @@ var ping_command Command = Command{ Interact: func(s *discordgo.Session, i *discordgo.InteractionCreate) { start := time.Now() - // Create a new HTTP client with a timeout client := http.Client{ Timeout: 5 * time.Second, } - // Send a GET request to the Discord API resp, err := client.Get("https://discord.com/api/v9/gateway/bot") if err != nil { fmt.Println("Error:", err) @@ -29,7 +27,6 @@ var ping_command Command = Command{ } defer resp.Body.Close() - // Calculate the ping ping := time.Since(start) s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource,