From 06809f2c40d8dcb4d6e47f2fb2ddda47463315f3 Mon Sep 17 00:00:00 2001 From: vaporvee Date: Wed, 21 Feb 2024 08:30:16 +0100 Subject: [PATCH] fixed merge issues --- command_ping.go | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 command_ping.go diff --git a/command_ping.go b/command_ping.go deleted file mode 100644 index 7ef8cab..0000000 --- a/command_ping.go +++ /dev/null @@ -1,38 +0,0 @@ -package main - -import ( - "fmt" - "net/http" - "time" - - "github.com/bwmarrin/discordgo" -) - -var ping_command Command = Command{ - Definition: discordgo.ApplicationCommand{ - Name: "ping", - Description: "Returns the ping of the bot", - }, - Interact: func(s *discordgo.Session, i *discordgo.InteractionCreate) { - start := time.Now() - - client := http.Client{ - Timeout: 5 * time.Second, - } - - resp, err := client.Get("https://discord.com/api/v9/gateway/bot") - if err != nil { - fmt.Println("Error:", err) - return - } - defer resp.Body.Close() - - ping := time.Since(start) - s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ - Type: discordgo.InteractionResponseChannelMessageWithSource, - Data: &discordgo.InteractionResponseData{ - Content: fmt.Sprintf("Ping: %.2fms", ping.Seconds()*1000), - }, - }) - }, -}