From 31f947fa7dc40d0a6a791e127d898f1f09c9795a Mon Sep 17 00:00:00 2001 From: sebm253 <42180891+sebm253@users.noreply.github.com> Date: Sun, 1 Dec 2024 17:18:12 +0100 Subject: [PATCH 1/2] Introduce QueryParams for use in rest endpoints --- rest/query_params.go | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 rest/query_params.go diff --git a/rest/query_params.go b/rest/query_params.go new file mode 100644 index 00000000..c18b99b0 --- /dev/null +++ b/rest/query_params.go @@ -0,0 +1,9 @@ +package rest + +import ( + "github.com/disgoorg/disgo/discord" +) + +type QueryParams interface { + ToQueryValues() discord.QueryValues +} From da7ac5d6cfd947118ce65c378874e2574a22446e Mon Sep 17 00:00:00 2001 From: sebm253 <42180891+sebm253@users.noreply.github.com> Date: Sun, 1 Dec 2024 17:23:49 +0100 Subject: [PATCH 2/2] add "docs" lol --- rest/query_params.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rest/query_params.go b/rest/query_params.go index c18b99b0..9d17c83d 100644 --- a/rest/query_params.go +++ b/rest/query_params.go @@ -4,6 +4,8 @@ import ( "github.com/disgoorg/disgo/discord" ) +// QueryParams serves as a generic interface for implementations of rest endpoint query parameters. type QueryParams interface { + // ToQueryValues transforms fields from the QueryParams interface implementations into discord.QueryValues. ToQueryValues() discord.QueryValues }