From dbfc49fb0863ec622ff5c319e3ce5002bc59c502 Mon Sep 17 00:00:00 2001 From: Nat Date: Sun, 15 Aug 2021 15:27:22 +1000 Subject: [PATCH] API: Fix Client.{Guild,}Command() (#264) --- api/application.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/api/application.go b/api/application.go index f0e7c72..ecc03da 100644 --- a/api/application.go +++ b/api/application.go @@ -23,11 +23,11 @@ func (c *Client) Commands(appID discord.AppID) ([]discord.Command, error) { } func (c *Client) Command( - appID discord.AppID, commandID discord.CommandID) ([]discord.Command, error) { + appID discord.AppID, commandID discord.CommandID) (discord.Command, error) { - var cmds []discord.Command - return cmds, c.RequestJSON( - &cmds, "GET", + var cmd discord.Command + return cmd, c.RequestJSON( + &cmd, "GET", EndpointApplications+appID.String()+"/commands/"+commandID.String(), ) } @@ -91,11 +91,11 @@ func (c *Client) GuildCommands( func (c *Client) GuildCommand( appID discord.AppID, guildID discord.GuildID, - commandID discord.CommandID) ([]discord.Command, error) { + commandID discord.CommandID) (discord.Command, error) { - var cmds []discord.Command - return cmds, c.RequestJSON( - &cmds, "GET", + var cmd discord.Command + return cmd, c.RequestJSON( + &cmd, "GET", EndpointApplications+appID.String()+ "/guilds/"+guildID.String()+ "/commands/"+commandID.String(),