From 167adb9b6feccd52e106787da723a15092e08828 Mon Sep 17 00:00:00 2001 From: Filip Hoffmann Date: Fri, 28 Aug 2026 23:28:01 +0200 Subject: [PATCH] get guild commands endpoint --- src/grom.gleam | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/grom.gleam b/src/grom.gleam index ef04d8b..2c9183b 100644 --- a/src/grom.gleam +++ b/src/grom.gleam @@ -21446,3 +21446,29 @@ pub fn bulk_ovewrite_global_commands_response( ) -> Result(List(Command), RestError) { handle_response(response:, decode_with: decode.list(of: command_decoder())) } + +pub fn get_guild_commands_request( + token token: Token, + current_application_id application_id: Snowflake(Application), + guild_id guild_id: Snowflake(Guild), + with_localizations with_localizations: Bool, +) -> Request(String) { + new_request( + token:, + to: "/applications/" + <> snowflake_to_string(application_id) + <> "/guilds/" + <> snowflake_to_string(guild_id) + <> "/commands", + method: http.Get, + ) + |> request.set_query([ + #("with_localizations", bool.to_string(with_localizations)), + ]) +} + +pub fn get_guild_commands_response( + response: Response(String), +) -> Result(List(Command), RestError) { + handle_response(response:, decode_with: decode.list(of: command_decoder())) +} -- 2.51.2